Class | restart_surftemp_io |
In: |
io/restart_surftemp_io.f90
|
Note that Japanese and English are described in parallel.
�°è¡¨�¢æ¸©åº������¹ã�¿ã�¼ã�����¼ã�¿ã������������¤ã���¼ã�¿ã���¥å�ºå����è¡����¾ã��. �¥å�����¡ã�¤ã��, �ºå�����¡ã�¤ã��, ���¼ã�¿ã���ºå���������� NAMELIST#restart_surftemp_io_nml �§è¨å®����¾ã��.
���¹ã�¿ã�¼ã�����¼ã�¿ã���¥å�����¡ã�¤ã������å®����������´å��, surface_data �¢ã�¸ã�¥ã�¼ã���§ç���������������¤ã���¼ã�¿ã����å¾����¾ã��.
Restart data or initial data is input/output. Settings of input file, output file, and interval of data output is configured by "NAMELIST#restart_surftemp_io_nml".
If input file of restart data is not set, initial data is generated in "surface_data" module, and obtained data from the module.
RestartSurfTempOpen : | ���¹ã�¿ã�¼ã�����¡ã�¤ã�������¼ã���� |
RestartSurfTempOutput : | ���¹ã�¿ã�¼ã�����¡ã�¤ã���¸ã�����¼ã�¿å�ºå�� |
RestartSurfTempClose : | ���¹ã�¿ã�¼ã�����¡ã�¤ã�������ã�¼ã�� |
RestartSurfTempGet : | ���¹ã�¿ã�¼ã�����¡ã�¤ã�����¥å�� |
———— : | ———— |
RestartSurfTempOpen : | Open restart file |
RestartSurfTempOutput : | Data output to restart file |
RestartSurfTempClose : | Close restart file |
RestartSurfTempGet : | Input restart file |
Subroutine : |
���¹ã�¿ã�¼ã�����¼ã�¿ã���¡ã�¤ã���ºå�����äº�������è¡����¾ã��.
Terminate restart data files output.
subroutine RestartSurfTempClose ! ! ���¹ã�¿ã�¼ã�����¼ã�¿ã���¡ã�¤ã���ºå�����äº�������è¡����¾ã��. ! ! Terminate restart data files output. ! �¢ã�¸ã�¥ã�¼ã����� ; USE statements ! ! gtool4 ���¼ã�¿å�ºå�� ! Gtool4 data output ! use gtool_history, only: HistoryClose ! 宣è��� ; Declaration statements ! ! ä½�æ¥å��� ! Work variables ! ! å®�è¡��� ; Executable statement ! if ( .not. restart_surftemp_opened ) return call HistoryClose( history = gthst_rst ) ! (inout) restart_surftemp_opened = .false. end subroutine RestartSurfTempClose
Subroutine : | |||
xy_SurfTemp(0:imax-1, 1:jmax) : | real(DP), intent(out)
| ||
xyz_SoilTemp(0:imax-1, 1:jmax, 1:kslmax) : | real(DP), intent(out) | ||
xy_SurfMajCompIceB(0:imax-1, 1:jmax) : | real(DP), intent(out) | ||
xy_SoilMoistB(0:imax-1, 1:jmax) : | real(DP), intent(out) | ||
xy_SurfSnowB(0:imax-1, 1:jmax) : | real(DP), intent(out) | ||
xy_SurfMajCompIceN(0:imax-1, 1:jmax) : | real(DP), intent(out) | ||
xy_SoilMoistN(0:imax-1, 1:jmax) : | real(DP), intent(out) | ||
xy_SurfSnowN(0:imax-1, 1:jmax) : | real(DP), intent(out) |
���¹ã�¿ã�¼ã�����¼ã�¿ã���¥å����è¡����¾ã��. ���¹ã�¿ã�¼ã�����¼ã�¿ã��å����������´å������, surface_data �¢ã�¸ã�¥ã�¼ã����������, �°è¡¨�¢æ¸©åº����¼ã�¿ç������è¡����¾ã��.
Input restart data. If restart data is not exist, surface temperature data is created by "surface_data".
subroutine RestartSurfTempGet( xy_SurfTemp, xyz_SoilTemp, xy_SurfMajCompIceB, xy_SoilMoistB, xy_SurfSnowB, xy_SurfMajCompIceN, xy_SoilMoistN, xy_SurfSnowN ) ! ! ���¹ã�¿ã�¼ã�����¼ã�¿ã���¥å����è¡����¾ã��. ! ���¹ã�¿ã�¼ã�����¼ã�¿ã��å����������´å������, ! surface_data �¢ã�¸ã�¥ã�¼ã����������, �°è¡¨�¢æ¸©åº����¼ã�¿ç������è¡����¾ã��. ! ! Input restart data. ! If restart data is not exist, ! surface temperature data is created by "surface_data". ! �¢ã�¸ã�¥ã�¼ã����� ; USE statements ! ! �°è¡¨�¢ã���¼ã�¿æ�ä¾� ! Prepare surface data ! use surface_data, only: SetSurfData ! ���»ç��� ! Time control ! use timeset, only: RestartTime ! ���¹ã�¿ã�¼ã����å§�����. ! Retart time of calculation ! gtool4 ���¼ã�¿å�¥å�� ! Gtool4 data input ! use gtool_history, only: HistoryGet ! ��å�����ä½� ! Character handling ! use dc_string, only: toChar ! NetCDF ���������¼ã���ã�°ã���� ! NetCDF wrapper ! use netcdf_wrapper, only: NWPresentAVarInFile ! 宣è��� ; Declaration statements ! real(DP), intent(out) :: xy_SurfTemp (0:imax-1, 1:jmax) ! �°è¡¨�¢æ¸©åº�. ! Surface temperature real(DP), intent(out) :: xyz_SoilTemp (0:imax-1, 1:jmax, 1:kslmax) real(DP), intent(out) :: xy_SurfMajCompIceB(0:imax-1, 1:jmax) real(DP), intent(out) :: xy_SoilMoistB (0:imax-1, 1:jmax) real(DP), intent(out) :: xy_SurfSnowB (0:imax-1, 1:jmax) real(DP), intent(out) :: xy_SurfMajCompIceN(0:imax-1, 1:jmax) real(DP), intent(out) :: xy_SoilMoistN (0:imax-1, 1:jmax) real(DP), intent(out) :: xy_SurfSnowN (0:imax-1, 1:jmax) ! ä½�æ¥å��� ! Work variables ! character(TOKEN) :: time_range ! ���»ã����å®�. ! Specification of time logical :: flag_mpi_init integer :: k ! å®�è¡��� ; Executable statement ! if ( .not. restart_surftemp_io_inited ) then call MessageNotify( 'E', module_name, 'This module has not been initialized.' ) end if ! The variable name is fixed, 'SurfTemp' (yot, 2011/09/10). !!$ if ( trim(InputFile) == '' .or. trim(InputName) == '' ) then if ( trim(InputFile) == '' ) then ! ���¼ã�¿ã�� surface_data �¢ã�¸ã�¥ã�¼ã��������å¾� ! Data is input from "surface_data" module ! call SetSurfData( xy_SurfTemp = xy_SurfTemp ) ! (out) optional do k = 1, kslmax xyz_SoilTemp(:,:,k) = xy_SurfTemp end do xy_SurfMajCompIceB = 0.0_DP xy_SoilMoistB = 0.0_DP xy_SurfSnowB = 0.0_DP xy_SurfMajCompIceN = xy_SurfMajCompIceB xy_SoilMoistN = xy_SoilMoistB xy_SurfSnowN = xy_SurfSnowB else ! ���¼ã�¿ã�� InputFile ������å¾� ! Data is input from InputFile ! ! ���»æ���±ã���å¾� ! Get time information ! time_range = time_name // '=' // toChar( RestartTime ) !!$ flag_mpi_init = .false. flag_mpi_init = .true. ! ���¼ã�¿å�¥å�� ! Data input ! call HistoryGet( InputFile, 'SurfTemp', range = time_range, array = xy_SurfTemp, flag_mpi_split = flag_mpi_init ) if ( kslmax /= 0 ) then if ( NWPresentAVarInFile( InputFile, 'SoilTemp' ) ) then call HistoryGet( InputFile, 'SoilTemp', range = time_range, array = xyz_SoilTemp, flag_mpi_split = flag_mpi_init ) else do k = 1, kslmax xyz_SoilTemp(:,:,k) = xy_SurfTemp end do call MessageNotify( 'M', module_name, 'Variable, %c, cannot be found in file, %c.', c1 = 'SoilTemp', c2 = trim(InputFile) ) call MessageNotify( 'M', module_name, 'Values in SoilTemp is assumed to be the same as SurfTemp.' ) end if end if if ( NWPresentAVarInFile( InputFile, 'SurfMajCompIceB' ) ) then call HistoryGet( InputFile, 'SurfMajCompIceB', range = time_range, array = xy_SurfMajCompIceB, flag_mpi_split = flag_mpi_init ) else xy_SurfMajCompIceB = 0.0_DP call MessageNotify( 'M', module_name, 'Variable, %c, cannot be found in file, %c.', c1 = 'SurfMajCompIceB', c2 = trim(InputFile) ) call MessageNotify( 'M', module_name, 'Values in SurfMajCompIceB is assumed to be zero.' ) end if if ( NWPresentAVarInFile( InputFile, 'SoilMoistB' ) ) then call HistoryGet( InputFile, 'SoilMoistB', range = time_range, array = xy_SoilMoistB, flag_mpi_split = flag_mpi_init ) else xy_SoilMoistB = 0.0_DP call MessageNotify( 'M', module_name, 'Variable, %c, cannot be found in file, %c.', c1 = 'SoilMoistB', c2 = trim(InputFile) ) call MessageNotify( 'M', module_name, 'Values in SoilMoistB is assumed to be zero.' ) end if if ( NWPresentAVarInFile( InputFile, 'SurfSnowB' ) ) then call HistoryGet( InputFile, 'SurfSnowB', range = time_range, array = xy_SurfSnowB, flag_mpi_split = flag_mpi_init ) else xy_SurfSnowB = 0.0_DP call MessageNotify( 'M', module_name, 'Variable, %c, cannot be found in file, %c.', c1 = 'SurfSnowB', c2 = trim(InputFile) ) call MessageNotify( 'M', module_name, 'Values in SurfSnowB is assumed to be zero.' ) end if if ( NWPresentAVarInFile( InputFile, 'SurfMajCompIceN' ) ) then call HistoryGet( InputFile, 'SurfMajCompIceN', range = time_range, array = xy_SurfMajCompIceN, flag_mpi_split = flag_mpi_init ) else xy_SurfMajCompIceN = xy_SurfMajCompIceB call MessageNotify( 'M', module_name, 'Variable, %c, cannot be found in file, %c.', c1 = 'SurfMajCompIceN', c2 = trim(InputFile) ) call MessageNotify( 'M', module_name, 'Values in SurfMajCompIceN is assumed to be the same as SurfMajCompIceB.' ) end if if ( NWPresentAVarInFile( InputFile, 'SoilMoistN' ) ) then call HistoryGet( InputFile, 'SoilMoistN', range = time_range, array = xy_SoilMoistN, flag_mpi_split = flag_mpi_init ) else xy_SoilMoistN = xy_SoilMoistB call MessageNotify( 'M', module_name, 'Variable, %c, cannot be found in file, %c.', c1 = 'SoilMoistN', c2 = trim(InputFile) ) call MessageNotify( 'M', module_name, 'Values in SoilMoistN is assumed to be the same as SoilMoistB.' ) end if if ( NWPresentAVarInFile( InputFile, 'SurfSnowN' ) ) then call HistoryGet( InputFile, 'SurfSnowN', range = time_range, array = xy_SurfSnowN, flag_mpi_split = flag_mpi_init ) else xy_SurfSnowN = xy_SurfSnowB call MessageNotify( 'M', module_name, 'Variable, %c, cannot be found in file, %c.', c1 = 'SurfSnowN', c2 = trim(InputFile) ) call MessageNotify( 'M', module_name, 'Values in SurfSnowN is assumed to be the same as SurfSnowB.' ) end if end if end subroutine RestartSurfTempGet
Subroutine : |
restart_surftemp_io �¢ã�¸ã�¥ã�¼ã������������è¡����¾ã��. NAMELIST#restart_surftemp_io_nml ����¿è¾¼�¿ã��������ç¶����§è�����¾ã��.
"restart_surftemp_io" module is initialized. "NAMELIST#restart_surftemp_io_nml" is loaded in this procedure.
This procedure input/output NAMELIST#restart_surftemp_io_nml .
subroutine RestartSurfTempInit ! ! restart_surftemp_io �¢ã�¸ã�¥ã�¼ã������������è¡����¾ã��. ! NAMELIST#restart_surftemp_io_nml ����¿è¾¼�¿ã��������ç¶����§è�����¾ã��. ! ! "restart_surftemp_io" module is initialized. ! "NAMELIST#restart_surftemp_io_nml" is loaded in this procedure. ! ! �¢ã�¸ã�¥ã�¼ã����� ; USE statements ! ! ���¹ã�¿ã�¼ã�����¼ã�¿å�¥å�ºå�� ! Restart data input/output ! use restart_file_io, only: restart_file_io_inited, RestartFileIntValue => IntValue, RestartFileIntUnit => IntUnit ! ���¹ã�¿ã�¼ã�����¼ã�¿ã���ºå����������ä½�. ! Unit for interval of restart data output ! ���»ç��� ! Time control ! use timeset, only: RestartTime ! ���¹ã�¿ã�¼ã����å§�����. ! Retart time of calculation ! NAMELIST ���¡ã�¤ã���¥å�����¢ã�������¼ã���£ã������ ! Utilities for NAMELIST file input ! use namelist_util, only: namelist_filename, NmlutilMsg ! �����¥æ��������±ã�� ! Calendar and Date handler ! use dc_calendar, only: DCCalConvertByUnit ! ���¡ã�¤ã���¥å�ºå��è£��� ! File I/O support ! use dc_iounit, only: FileOpen ! ç¨��¥å�������¡ã�� ! Kind type parameter ! use dc_types, only: STDOUT ! æ¨�æº��ºå�����ç½����. Unit number of standard output ! 宣è��� ; Declaration statements ! ! ä½�æ¥å��� ! Work variables ! integer:: unit_nml ! NAMELIST ���¡ã�¤ã�����¼ã���³ç���ç½����. ! Unit number for NAMELIST file open integer:: iostat_nml ! NAMELIST èªã�¿è¾¼�¿æ���� IOSTAT. ! IOSTAT of NAMELIST read ! NAMELIST å¤��°ç¾¤ ! NAMELIST group name ! namelist /restart_surftemp_io_nml/ InputFile, OutputFile, IntValue, IntUnit ! ! �����������¤ã���¤ã��������������ç¶� "restart_surftemp_io#RestartSurfTempInit" ! ���½ã�¼ã�¹ã�³ã�¼ã�������§ã������. ! ! Refer to source codes in the initialization procedure ! "restart_surftemp_io#RestartSurfTempInit" for the default values. ! ! å®�è¡��� ; Executable statement ! if ( restart_surftemp_io_inited ) return ! �����������¤ã��¨å®� ! Default values settings ! InputFile = '' ! The variable name is fixed, 'SurfTemp' (yot, 2011/09/10). !!$ InputName = 'SurfTemp' if ( .not. flag_init_data_save ) then OutputFile = 'rst_sst.nc' else OutputFile = 'sst.nc' end if if ( restart_file_io_inited ) then IntValue = RestartFileIntValue IntUnit = RestartFileIntUnit else IntValue = 365.0_DP IntUnit = 'day' end if ! NAMELIST ����¿è¾¼�� ! NAMELIST is input ! if ( trim(namelist_filename) /= '' ) then call FileOpen( unit_nml, namelist_filename, mode = 'r' ) ! (in) rewind( unit_nml ) read( unit_nml, nml = restart_surftemp_io_nml, iostat = iostat_nml ) ! (out) close( unit_nml ) call NmlutilMsg( iostat_nml, module_name ) ! (in) if ( iostat_nml == 0 ) write( STDOUT, nml = restart_surftemp_io_nml ) end if ! �ºå������������¨å®� ! Configure time interval of output ! IntTime = DCCalConvertByUnit( IntValue, IntUnit, 'sec' ) ! (in) PrevOutputTime = RestartTime ! �����°ã�������� ! Initialize flag ! flag_output_end = .false. ! �°å� ; Print ! call MessageNotify( 'M', module_name, '----- Initialization Messages -----' ) call MessageNotify( 'M', module_name, 'Input:: ' ) call MessageNotify( 'M', module_name, ' InputFile = %c', c1 = trim(InputFile) ) ! The variable name is fixed, 'SurfTemp' (yot, 2011/09/10). !!$ call MessageNotify( 'M', module_name, ' InputName = %c', c1 = trim(InputName) ) call MessageNotify( 'M', module_name, 'Output:: ' ) call MessageNotify( 'M', module_name, ' OutputFile = %c', c1 = trim(OutputFile) ) call MessageNotify( 'M', module_name, ' IntTime = %f [%c]', d = (/ IntValue /), c1 = trim(IntUnit) ) call MessageNotify( 'M', module_name, '-- version = %c', c1 = trim(version) ) restart_surftemp_io_inited = .true. end subroutine RestartSurfTempInit
Subroutine : | |||
flag_init_data : | logical, intent(in), optional
|
���¹ã�¿ã�¼ã�����¡ã�¤ã�������¼ã���³ã���¾ã��.
A restart file is opened.
subroutine RestartSurfTempOpen( flag_init_data ) ! ! ���¹ã�¿ã�¼ã�����¡ã�¤ã�������¼ã���³ã���¾ã��. ! ! A restart file is opened. ! ! �¢ã�¸ã�¥ã�¼ã����� ; USE statements ! ! �ºå�����¡ã�¤ã�����ºæ������ ! Basic information for output files ! use fileset, only: FileTitle, FileSource, FileInstitution ! ���¼ã�¿ã���¡ã�¤ã������çµ�������´ã����çµ�ç¹�/��äº�. ! Institution or person that changes data files for the last time ! �����»æ�°å¦å®��°è¨å®� ! Physical and mathematical constants settings ! use constants0, only: PI ! $ \pi $. ! �����. Circular constant ! 座æ����¼ã�¿è¨å®� ! Axes data settings ! use axesset, only: x_Lon, x_Lon_Weight, y_Lat, y_Lat_Weight, z_SSDepth ! �°ä����¼å��¹ã��·±�� ! subsurface grid at midpoint of layer ! ���»ç��� ! Time control ! use timeset, only: DelTime, RestartTime ! ���¹ã�¿ã�¼ã����å§�����. ! Retart time of calculation ! gtool4 ���¼ã�¿å�ºå�� ! Gtool4 data output ! use gtool_history, only: HistoryCreate, HistoryAddVariable, HistoryPut, HistoryAddAttr ! ��å�����ä½� ! Character handling ! use dc_string, only: StoA, CPrintf, LChar ! çµ��¿è¾¼�¿é�¢æ�� PRESENT ���¡å¼µ���¢æ�� ! Extended functions of intrinsic function "PRESENT" ! use dc_present, only: present_and_true ! 宣è��� ; Declaration statements ! logical, intent(in), optional:: flag_init_data ! �����¤ã���¼ã�¿ã��ä½��������´å����, ! ������°ã�� .true. ��ä¸����¾ã��. ! ! If initial data is created, ! give ".true." to this argument. ! ä½�æ¥å��� ! Work variables ! character(STRING):: title_msg ! è¡������������¡ã���»ã�¼ã��. ! Message added to title real(DP):: origin_time ! è¨�ç®���å§�����. ! Start time of calculation character(STRING):: time_unit ! �¥æ������ä½�. Units of date and time logical:: flag_mpi_init ! å®�è¡��� ; Executable statement ! ! ������ ! Initialization ! flag_init_data_save = present_and_true( flag_init_data ) if ( .not. restart_surftemp_io_inited ) then call MessageNotify( 'E', module_name, 'This module has not been initialized.' ) end if if ( restart_surftemp_opened ) return ! è¡������������¡ã���»ã�¼ã�¸ã��¨å®� ! Configure message added to title ! if ( .not. flag_init_data_save ) then title_msg = ' restart data of surface temperature' else title_msg = ' initial data of surface temperature' end if ! ���»æ���±ã���å¾� ! Get time information ! if ( .not. flag_init_data_save ) then origin_time = RestartTime + IntTime else origin_time = RestartTime end if time_unit = IntUnit flag_mpi_init = .true. ! ���¹ã�¿ã�¼ã�����¡ã�¤ã�������¼ã���� ! Open a restart file ! if ( kslmax /= 0 ) then call HistoryCreate( file = OutputFile, title = trim(FileTitle) // trim(title_msg), source = FileSource, institution = FileInstitution, dims = StoA( 'lon', 'lat', 'dep', time_name ), dimsizes = (/ imax, jmax, kslmax, 0 /), longnames = StoA( 'longitude', 'latitude', 'depth ', time_name ), units = StoA( 'degree_east', 'degree_north', 'm ', time_unit ), origind = origin_time, intervald = IntValue, flag_mpi_split = flag_mpi_init, history = gthst_rst ) else call HistoryCreate( file = OutputFile, title = trim(FileTitle) // trim(title_msg), source = FileSource, institution = FileInstitution, dims = StoA( 'lon', 'lat', time_name ), dimsizes = (/ imax, jmax, 0 /), longnames = StoA( 'longitude', 'latitude', time_name ), units = StoA( 'degree_east', 'degree_north', time_unit ), xtypes = (/'double', 'double', 'double'/), origind = origin_time, intervald = IntValue, flag_mpi_split = flag_mpi_init, history = gthst_rst ) end if ! 座æ����¼ã�¿ã��¨å®� ! Axes data settings ! call HistoryAddAttr( varname = 'lon', attrname = 'standard_name', value = 'longitude', history = gthst_rst ) call HistoryAddAttr( varname = 'lat', attrname = 'standard_name', value = 'latitude', history = gthst_rst ) if ( kslmax /= 0 ) then call HistoryAddAttr( varname = 'dep', attrname = 'standard_name', value = 'depth', history = gthst_rst ) end if call HistoryAddAttr( varname = time_name, attrname = 'standard_name', value = 'time', history = gthst_rst ) call HistoryPut( varname = 'lon', array = x_Lon / PI * 180.0_DP, history = gthst_rst ) call HistoryPut( varname = 'lat', array = y_Lat / PI * 180.0_DP, history = gthst_rst ) if ( kslmax /= 0 ) then call HistoryPut( varname = 'dep', array = z_SSDepth, history = gthst_rst ) end if ! 座æ����¿ã��¨å®� ! Axes weights settings ! call HistoryAddVariable( varname = 'lon_weight', dims = StoA('lon'), longname = 'weight for integration in longitude', units = 'radian', xtype = 'double', history = gthst_rst ) ! (inout) call HistoryAddAttr( varname = 'lon', attrname = 'gt_calc_weight', value = 'lon_weight', history = gthst_rst ) ! (inout) call HistoryPut( varname = 'lon_weight', array = x_Lon_Weight, history = gthst_rst ) ! (inout) call HistoryAddVariable( varname = 'lat_weight', dims = StoA('lat'), longname = 'weight for integration in latitude', units = 'radian', xtype = 'double', history = gthst_rst ) ! (inout) call HistoryAddAttr( varname = 'lat', attrname = 'gt_calc_weight', value = 'lat_weight', history = gthst_rst ) ! (inout) call HistoryPut( varname = 'lat_weight', array = y_Lat_Weight, history = gthst_rst ) ! (inout) ! äº��±å��°ã��¨å®� ! Predictional variables settings ! call HistoryAddVariable( varname = 'SurfTemp', dims = StoA('lon', 'lat', time_name), longname = 'surface temperature', units = 'K', xtype = 'double', history = gthst_rst ) if ( kslmax /= 0 ) then call HistoryAddVariable( varname = 'SoilTemp', dims = StoA('lon', 'lat', 'dep', time_name), longname = 'soil temperature', units = 'K', xtype = 'double', history = gthst_rst ) end if call HistoryAddVariable( varname = 'SurfMajCompIceB', dims = StoA('lon', 'lat', time_name), longname = 'major component ice amount on the surface', units = 'kg m-2', xtype = 'double', history = gthst_rst ) call HistoryAddVariable( varname = 'SoilMoistB', dims = StoA('lon', 'lat', time_name), longname = 'soil moisture', units = 'kg m-2', xtype = 'double', history = gthst_rst ) call HistoryAddVariable( varname = 'SurfSnowB', dims = StoA('lon', 'lat', time_name), longname = 'snow amount on the surface', units = 'kg m-2', xtype = 'double', history = gthst_rst ) call HistoryAddVariable( varname = 'SurfMajCompIceN', dims = StoA('lon', 'lat', time_name), longname = 'major component ice amount on the surface', units = 'kg m-2', xtype = 'double', history = gthst_rst ) call HistoryAddVariable( varname = 'SoilMoistN', dims = StoA('lon', 'lat', time_name), longname = 'soil moisture', units = 'kg m-2', xtype = 'double', history = gthst_rst ) call HistoryAddVariable( varname = 'SurfSnowN', dims = StoA('lon', 'lat', time_name), longname = 'snow amount on the surface', units = 'kg m-2', xtype = 'double', history = gthst_rst ) restart_surftemp_opened = .true. end subroutine RestartSurfTempOpen
Subroutine : | |||
xy_SurfTemp(0:imax-1, 1:jmax) : | real(DP), intent(in)
| ||
xyz_SoilTemp(0:imax-1, 1:jmax, 1:kslmax) : | real(DP), intent(in), optional | ||
xy_SurfMajCompIceB(0:imax-1, 1:jmax) : | real(DP), intent(in), optional | ||
xy_SoilMoistB(0:imax-1, 1:jmax) : | real(DP), intent(in), optional | ||
xy_SurfSnowB(0:imax-1, 1:jmax) : | real(DP), intent(in), optional | ||
xy_SurfMajCompIceN(0:imax-1, 1:jmax) : | real(DP), intent(in), optional | ||
xy_SoilMoistN(0:imax-1, 1:jmax) : | real(DP), intent(in), optional | ||
xy_SurfSnowN(0:imax-1, 1:jmax) : | real(DP), intent(in), optional |
���¹ã�¿ã�¼ã�����¼ã�¿ã���ºå����è¡����¾ã��.
Output restart data
subroutine RestartSurfTempOutput( xy_SurfTemp, xyz_SoilTemp, xy_SurfMajCompIceB, xy_SoilMoistB, xy_SurfSnowB, xy_SurfMajCompIceN, xy_SoilMoistN, xy_SurfSnowN ) ! ! ���¹ã�¿ã�¼ã�����¼ã�¿ã���ºå����è¡����¾ã��. ! ! Output restart data ! �¢ã�¸ã�¥ã�¼ã����� ; USE statements ! ! gtool4 ���¼ã�¿å�ºå�� ! Gtool4 data output ! use gtool_history, only: HistoryPut, HistorySetTime ! ���»ç��� ! Time control ! use timeset, only: TimeN, EndTime ! è¨�ç®�çµ�äº�����. ! End time of calculation ! çµ��¿è¾¼�¿é�¢æ�� PRESENT ���¡å¼µ���¢æ�� ! Extended functions of intrinsic function "PRESENT" ! use dc_present, only: present_and_true ! 宣è��� ; Declaration statements ! real(DP), intent(in) :: xy_SurfTemp (0:imax-1, 1:jmax) ! �°è¡¨�¢æ¸©åº�. ! Surface temperature real(DP), intent(in), optional :: xyz_SoilTemp (0:imax-1, 1:jmax, 1:kslmax) real(DP), intent(in), optional :: xy_SurfMajCompIceB(0:imax-1, 1:jmax) real(DP), intent(in), optional :: xy_SoilMoistB (0:imax-1, 1:jmax) real(DP), intent(in), optional :: xy_SurfSnowB (0:imax-1, 1:jmax) real(DP), intent(in), optional :: xy_SurfMajCompIceN(0:imax-1, 1:jmax) real(DP), intent(in), optional :: xy_SoilMoistN (0:imax-1, 1:jmax) real(DP), intent(in), optional :: xy_SurfSnowN (0:imax-1, 1:jmax) ! ä½�æ¥å��� ! Work variables ! logical:: flag_output ! �ºå����������. ! Flag for output ! å®�è¡��� ; Executable statement ! if ( .not. restart_surftemp_opened ) call RestartSurfTempOpen ! �ºå���¿ã�¤ã���³ã�°ã�����§ã���� ! Check output timing ! flag_output = TimeN - PrevOutputTime >= IntTime if ( TimeN >= EndTime .and. .not. flag_output_end ) then flag_output = .true. flag_output_end = .true. end if flag_output = ( .not. TimeN == PrevOutputTime ) .and. flag_output flag_output = flag_init_data_save .or. flag_output if ( .not. flag_output ) return ! 次å������, ä»������ºå�� (å¸���) ���� ��ä¿�å� ! Save output time (expected) in this time, for next time ! PrevOutputTime = PrevOutputTime + IntTime ! ���»ã��¨å®� ! Set time ! call HistorySetTime( timed = TimeN, history = gthst_rst ) ! ���¼ã�¿å�ºå�� ! Data output ! call HistoryPut( 'SurfTemp' , xy_SurfTemp , history = gthst_rst ) ! (in) if ( present( xyz_SoilTemp ) ) then if ( kslmax /= 0 ) then call HistoryPut( 'SoilTemp' , xyz_SoilTemp , history = gthst_rst ) ! (in) end if end if if ( present( xy_SurfMajCompIceB ) ) then call HistoryPut( 'SurfMajCompIceB', xy_SurfMajCompIceB, history = gthst_rst ) ! (in) end if if ( present( xy_SoilMoistB ) ) then call HistoryPut( 'SoilMoistB', xy_SoilMoistB, history = gthst_rst ) ! (in) end if if ( present( xy_SurfSnowB ) ) then call HistoryPut( 'SurfSnowB' , xy_SurfSnowB , history = gthst_rst ) ! (in) end if if ( present( xy_SurfMajCompIceN ) ) then call HistoryPut( 'SurfMajCompIceN', xy_SurfMajCompIceN, history = gthst_rst ) ! (in) end if if ( present( xy_SoilMoistN ) ) then call HistoryPut( 'SoilMoistN', xy_SoilMoistN, history = gthst_rst ) ! (in) end if if ( present( xy_SurfSnowN ) ) then call HistoryPut( 'SurfSnowN' , xy_SurfSnowN , history = gthst_rst ) ! (in) end if end subroutine RestartSurfTempOutput
Variable : | |||
restart_surftemp_io_inited = .false. : | logical, save, public
|
Variable : | |||
restart_surftemp_opened = .false. : | logical, save, public
|
Variable : | |||
InputFile : | character(STRING), save
|
Variable : | |||
IntTime : | real(DP), save
|
Variable : | |||
IntUnit : | character(TOKEN)
|
Variable : | |||
IntValue : | real(DP), save
|
Variable : | |||
OutputFile : | character(STRING), save
|
Constant : | |||
deltime_name = ‘deltime‘ : | character(*), parameter
|
Variable : | |||
flag_init_data_save : | logical, save
|
Variable : | |||
flag_output_end : | logical, save
|
Variable : | |||
gthst_rst : | type(GT_HISTORY), save
|
Constant : | |||
module_name = ‘restart_surftemp_io‘ : | character(*), parameter
|
Constant : | |||
time_name = ‘time‘ : | character(*), parameter
|
Constant : | |||
version = ’$Name: $’ // ’$Id: restart_surftemp_io.f90,v 1.11 2014/05/07 09:39:18 murashin Exp $’ : | character(*), parameter
|