diff --git a/ccpp/physics b/ccpp/physics index 449343f16..24643b0e0 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 449343f16e87e149f05a76b565287c77f53ccf83 +Subproject commit 24643b0e0f9754d76176d60ce155bf8956bfb44d diff --git a/io/module_wrt_grid_comp.F90 b/io/module_wrt_grid_comp.F90 index af468c57e..f62fadf1a 100644 --- a/io/module_wrt_grid_comp.F90 +++ b/io/module_wrt_grid_comp.F90 @@ -1,31 +1,33 @@ -!----------------------------------------------------------------------- -! +!> @file +!> @brief Write grid component module. +!> @author J. Wang/G. Theurich @date Jul, 2017 + +!> @brief Write grid component. +!> +!> At initialization step, write grid is defined. The forecast field +!> bundle is mirrored and output field information inside the field +!> bundle is used to create ESMF field on the write grid and added in +!> the output field bundle on write grid component. Also the IO_BaseTime +!> is set to the initial clock time. +!> +!> At the run step, output time is set from the write grid comp clock +!> the ESMF field bundles that contains the data on write grid are +!> written out through ESMF field bundle write to netcdf files. +!> The ESMF field bundle write uses parallel write, so if output grid +!> is cubed sphere grid, the six tiles file will be written out at +!> same time. +!> +!> ## Module History +!> +!> Date | Programmer | Modification +!> -----|------------|------------- +!> Jul 2017 | J. Wang/G. Theurich | initial code for fv3 write grid component +!> Mar 2018 | S Moorthi | changing cfhour to accommodate up to 99999 hours +!> Aug 2019 | J. Wang | add inline post +!> +!> @author Jun Wang @date Jul, 2019 module module_wrt_grid_comp -! -!----------------------------------------------------------------------- -!*** This module includes the functionality of write gridded component. -!----------------------------------------------------------------------- -!*** At initialization step, write grid is defined. The forecast field -!*** bundle is mirrored and output field information inside the field -!*** bundle is used to create ESMF field on the write grid and added in -!*** the output field bundle on write grid component. Also the IO_BaseTime -!*** is set to the initial clock time. -!*** At the run step, output time is set from the write grid comp clock -!*** the ESMF field bundles that contains the data on write grid are -!*** written out through ESMF field bundle write to netcdf files. -!*** The ESMF field bundle write uses parallel write, so if output grid -!*** is cubed sphere grid, the six tiles file will be written out at -!*** same time. -!----------------------------------------------------------------------- -!*** -!*** Revision history -!*** -! Jul 2017: J. Wang/G. Theurich - initial code for fv3 write grid component -! Mar 2018: S Moorthi - changing cfhour to accommodate up to 99999 hours -! Aug 2019: J. Wang - add inline post -! -!--------------------------------------------------------------------------------- -! + use mpi use mpi_f08 use esmf use fms, only : fms_init, fms_end, fms_mpp_uppercase, fms_mpp_error, FATAL @@ -61,32 +63,35 @@ module module_wrt_grid_comp !----------------------------------------------------------------------- ! ! - integer,save :: lead_write_task !<-- Rank of the first write task in the write group - integer,save :: last_write_task !<-- Rank of the last write task in the write group - integer,save :: ntasks !<-- # of write tasks in the current group - integer,save :: itasks, jtasks !<-- # of write tasks in i/j direction in the current group - integer,save :: ngrids - - type(MPI_Comm),save :: wrt_mpi_comm !<-- the mpi communicator in the write comp - integer,save :: idate(7), start_time(7) - logical,save :: write_nsflip - logical,save :: change_wrtidate=.false. - integer,save :: frestart(999) = -1 - integer,save :: calendar_type = 3 - logical :: lprnt + integer,save :: lead_write_task !< Rank of the first write task in the write group. + integer,save :: last_write_task !< Rank of the last write task in the write group. + integer,save :: ntasks !< Number of write tasks in the current group. + integer,save :: itasks !< Number of write tasks in i direction in the current group. + integer,save :: jtasks !< Number of write tasks in j direction in the current group. + integer,save :: ngrids !< Number of output grids + + integer,save :: wrt_mpi_comm !< The mpi communicator in the write comp. + integer,save :: idate(7) !< IO base time array + integer,save :: start_time(7) !< Experiment starting time + logical,save :: write_nsflip !< Flag to flip y-coordinate + logical,save :: change_wrtidate=.false. !< Flag to change output time + integer,save :: frestart(999) = -1 !< Restart time/frequency array + integer,save :: calendar_type = 3 !< Calendar type + logical :: lprnt !< Flag for debug prints ! !----------------------------------------------------------------------- ! - type(ESMF_FieldBundle) :: gridFB - integer :: FBCount - character(len=esmf_maxstr),allocatable :: fcstItemNameList(:) - character(128) :: FBlist_outfilename(100) - logical :: top_parent_is_global + type(ESMF_FieldBundle) :: gridFB !< Temporary field bundle for axes information + integer :: FBCount !< Number of field bundles + character(len=esmf_maxstr),allocatable :: fcstItemNameList(:) !< Forecast item name list + character(128) :: FBlist_outfilename(100) !< Output file name + logical :: top_parent_is_global !< Flag, .true. when the top partent domain is global ! !----------------------------------------------------------------------- - REAL(KIND=8) :: btim,btim0 - REAL(KIND=8),PUBLIC,SAVE :: write_init_tim, write_run_tim - REAL(KIND=8), parameter :: radi=180.0d0/pi + REAL(KIND=8) :: btim0 !< Begining time + REAL(KIND=8),PUBLIC,SAVE :: write_init_tim !< Write grid component initialization time + REAL(KIND=8),PUBLIC,SAVE :: write_run_tim !< Write grid component run time + REAL(KIND=8), parameter :: radi=180.0d0/pi !< Radius !----------------------------------------------------------------------- ! public SetServices @@ -97,16 +102,19 @@ module module_wrt_grid_comp end interface splat ! type optimizeT - type(ESMF_State) :: state - type(ESMF_GridComp), allocatable :: comps(:) + type(ESMF_State) :: state !< ESMF state + type(ESMF_GridComp), allocatable :: comps(:) !< ESMF grid components end type contains -! -!----------------------------------------------------------------------- -!####################################################################### -!----------------------------------------------------------------------- -! + + !> NUOPC Interface to indicate the generic component being specialized + !> and register any specialization points + !> + !> @param wrt_comp write grid component + !> @param rc Return code. + !> + !> @author J. Wang/G. Theurich @date Jul, 2017 subroutine SetServices(wrt_comp, rc) type(ESMF_GridComp) :: wrt_comp integer, intent(out) :: rc @@ -134,11 +142,16 @@ subroutine SetServices(wrt_comp, rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return end subroutine SetServices -! -!----------------------------------------------------------------------- -!####################################################################### -!----------------------------------------------------------------------- -! + + !> Write grid component initialization phase 1 + !> + !> @param wrt_comp Write grid component + !> @param imp_state_write Write grid component import state + !> @param exp_state_write Write grid component export state + !> @param clock ESMF clock for the write grid component + !> @param[out] rc Return code. + !> + !> @author J. Wang/G. Theurich @date Jul, 2017 subroutine wrt_initialize_p1(wrt_comp, imp_state_write, exp_state_write, clock, rc) ! !----------------------------------------------------------------------- @@ -1434,6 +1447,15 @@ end subroutine wrt_initialize_p1 !####################################################################### !----------------------------------------------------------------------- ! + !> Write grid component initialization phase 2 + !> + !> @param wrt_comp Write grid component + !> @param imp_state_write Write grid component import state + !> @param exp_state_write Write grid component export state + !> @param clock ESMF clock for the write grid component + !> @param[out] rc Return code. + !> + !> @author J. Wang/G. Theurich @date Jul, 2017 subroutine wrt_initialize_p2(wrt_comp, imp_state_write, exp_state_write, clock, rc) ! !----------------------------------------------------------------------- @@ -1529,11 +1551,16 @@ subroutine wrt_initialize_p2(wrt_comp, imp_state_write, exp_state_write, clock, !----------------------------------------------------------------------- ! end subroutine wrt_initialize_p2 -! -!----------------------------------------------------------------------- -!####################################################################### -!----------------------------------------------------------------------- -! + + !> Write grid component initialization phase 3 + !> + !> @param wrt_comp Write grid component + !> @param imp_state_write Write grid component import state + !> @param exp_state_write Write grid component export state + !> @param clock ESMF clock for the write grid component + !> @param[out] rc Return code. + !> + !> @author J. Wang/G. Theurich @date Jul, 2017 subroutine wrt_initialize_p3(wrt_comp, imp_state_write, exp_state_write, clock, rc) ! !----------------------------------------------------------------------- @@ -1628,11 +1655,16 @@ subroutine wrt_initialize_p3(wrt_comp, imp_state_write, exp_state_write, clock, !----------------------------------------------------------------------- ! end subroutine wrt_initialize_p3 -! -!----------------------------------------------------------------------- -!####################################################################### -!----------------------------------------------------------------------- -! + + !> Write grid component run phase + !> + !> @param wrt_comp Write grid component + !> @param imp_state_write Write grid component import state + !> @param exp_state_write Write grid component export state + !> @param clock ESMF clock for the write grid component + !> @param[out] rc Return code. + !> + !> @author J. Wang/G. Theurich @date Jul, 2017 subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) ! !----------------------------------------------------------------------- @@ -2466,11 +2498,16 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) !----------------------------------------------------------------------- ! END SUBROUTINE wrt_run -! -!----------------------------------------------------------------------- -!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& -!----------------------------------------------------------------------- -! + + !> Write grid component finalize phase + !> + !> @param wrt_comp Write grid component + !> @param imp_state_write Write grid component import state + !> @param exp_state_write Write grid component export state + !> @param clock ESMF clock for the write grid component + !> @param[out] rc Return code. + !> + !> @author J. Wang/G. Theurich @date Jul, 2017 subroutine wrt_finalize(wrt_comp, imp_state_write, exp_state_write, clock, rc) ! !----------------------------------------------------------------------- @@ -2519,6 +2556,12 @@ end subroutine wrt_finalize ! !----------------------------------------------------------------------- ! + !> Recover the fields interpolated through vector interpolation + !> + !> @param[in] file_bundle Field bundle + !> @param[out] rc Return code. + !> + !> @author J. Wang/G. Theurich @date Jul, 2017 subroutine recover_fields(file_bundle,rc) type(ESMF_FieldBundle), intent(in) :: file_bundle @@ -2758,6 +2801,12 @@ end subroutine recover_fields ! !----------------------------------------------------------------------- ! + !> Add undefined value mask to ESMF fields in an output file bundle + !> + !> @param[in] file_bundle Output field bundle + !> @param[out] rc Return code. + !> + !> @author J. Wang/G. Theurich @date Jul, 2017 subroutine mask_fields(file_bundle,rc) type(ESMF_FieldBundle), intent(in) :: file_bundle @@ -3016,6 +3065,19 @@ end subroutine mask_fields !----------------------------------------------------------------------- ! + !> ESMF prototype interface to write out tiled field bundles + !> + !> @param[in] file_bundle Output ESMF field bundles + !> @param[in] fileName File name + !> @param[in] convention Convention of attribute package + !> @param[in] purpose Purpose of attribute package + !> @param[in] status ESMF file status flag + !> @param[in] timeslice Time slice + !> @param[in] state ESMF state + !> @param[in] comps ESMF grid component + !> @param[out] rc Return code. + !> + !> @author J. Wang/G. Theurich @date Jul, 2017 subroutine ESMFproto_FieldBundleWrite(fieldbundle, fileName, & convention, purpose, status, timeslice, state, comps, rc) type(ESMF_FieldBundle), intent(in) :: fieldbundle @@ -3324,6 +3386,12 @@ end subroutine ESMFproto_FieldBundleWrite !----------------------------------------------------------------------------- + !> IO component set services + !> + !> @param[in] comp ESMF grid component + !> @param[out] rc Return code. + !> + !> @author J. Wang/G. Theurich @date Jul, 2017 subroutine ioCompSS(comp, rc) type(ESMF_GridComp) :: comp integer, intent(out) :: rc @@ -3339,6 +3407,15 @@ subroutine ioCompSS(comp, rc) !----------------------------------------------------------------------------- + !> IO component run phase + !> + !> @param comp The ESMF grid component + !> @param importState Import state + !> @param exportState Export State + !> @param clock ESMF clock + !> @param[out] rc Return code. + !> + !> @author G. Theurich @date Jul, 2017 subroutine ioCompRun(comp, importState, exportState, clock, rc) use netcdf @@ -3717,6 +3794,12 @@ subroutine ioCompRun(comp, importState, exportState, clock, rc) contains + !> Write out ungridded dimension attributes + !> + !> @param[in] dimLablel Dimension label + !> @param[out] rc Return code. + !> + !> @author G. Theurich @date Jul, 2017 subroutine write_out_ungridded_dim_atts(dimLabel, rc) character(len=*) :: dimLabel integer, intent(out) :: rc @@ -3877,6 +3960,13 @@ subroutine write_out_ungridded_dim_atts(dimLabel, rc) endif end subroutine write_out_ungridded_dim_atts + !> Write out ungridded dimension attributes from the ESMF fields + !> + !> @param[in] field ESMF field + !> @param[in] dimLabel Dimension label + !> @param[out] rc Return code. + !> + !> @author J. Wang/G. Theurich @date Jul, 2017 subroutine write_out_ungridded_dim_atts_from_field(field, dimLabel, rc) type(ESMF_Field),intent(in) :: field @@ -4022,6 +4112,15 @@ end subroutine ioCompRun !----------------------------------------------------------------------------- + !> ESMF prototype to geta field on a single tile from a field on multitiles + !> + !> @param[in] field ESMF field + !> @param[in] tile Tile number + !> @param[in] tileField ESMF field on the single tile + !> @param[in] petList PET list on the single tile + !> @param[out] rc Return code. + !> + !> @author G. Theurich @date Jul, 2017 subroutine ESMFproto_FieldMakeSingleTile(field, tile, tileField, petList, rc) type(ESMF_Field), intent(in) :: field integer, intent(in) :: tile @@ -4221,8 +4320,13 @@ subroutine ESMFproto_FieldMakeSingleTile(field, tile, tileField, petList, rc) end subroutine ESMFproto_FieldMakeSingleTile -! -!----------------------------------------------------------------------- + !> Compute sine latitiude in real(4) from grid type + !> + !> @param[in] idrt Data representation type + !> @param[in] jmax Maximum on j-direction + !> @param[out] aslat SINE of latitude in real(4) + !> + !> @author J. Wang @date Jul, 2017 subroutine splat4(idrt,jmax,aslat) implicit none @@ -4332,7 +4436,14 @@ subroutine splat4(idrt,jmax,aslat) ENDIF ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - end subroutine splat4 -!---------------------------------------------------------------------- + + !> Compute sine latitiude in real(8) from grid type + !> + !> @param[in] idrt Data representation type + !> @param[in] jmax Maximum on j-direction + !> @param[out] aslat SINE of latitude in real(8) + !> + !> @author J. Wang @date Jul, 2017 subroutine splat8(idrt,jmax,aslat) !$$$ implicit none @@ -4441,8 +4552,17 @@ subroutine splat8(idrt,jmax,aslat) ENDIF ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - end subroutine splat8 -! -! + + !> Compute geographical lat/lon from rotated lat/lon grid + !> + !> @param[in] tlmd Rotated Longitude + !> @param[in] tphd Rotated Latitude + !> @param[out] almd Geographical longitude + !> @param[out] aphd Geographical latitude + !> @param[in] tlm0d Central longitude + !> @param[in] tph0d Central latitude + !> + !> @author D. Jovic @date Jul, 2017 subroutine rtll(tlmd,tphd,almd,aphd,tlm0d,tph0d) !------------------------------------------------------------------------------- real(ESMF_KIND_R8), intent(in) :: tlmd, tphd @@ -4493,9 +4613,20 @@ subroutine rtll(tlmd,tphd,almd,aphd,tlm0d,tph0d) return ! end subroutine rtll -! -!----------------------------------------------------------------------- -! + + !> Compute lambert comformal projection + !> + !> @param[in] stlat1 First standard parallel + !> @param[in] stlat2 Second standard parallel + !> @param[in] c_lat Central latitude + !> @param[in] c_lon Central longitude + !> @param[inout] glon Longitude + !> @param[inout] glat Latitude + !> @param[inout] x Lambert X coordinate + !> @param[inout] y Lambert Y coordinate + !> @param[in] inv Transformation indicator + !> + !> @author D. Jovic @date Jul, 2017 subroutine lambert(stlat1,stlat2,c_lat,c_lon,glon,glat,x,y,inv) !------------------------------------------------------------------------------- @@ -4555,9 +4686,15 @@ subroutine lambert(stlat1,stlat2,c_lat,c_lon,glon,glat,x,y,inv) return end subroutine lambert -! -!----------------------------------------------------------------------- -! + + !> Get output file names + !> + !> @param[in] nfl Number of fields + !> @param[in] filename File name specified in each fiels + !> @param[inout] outfile_name Output file names + !> @param[inout] noutfile Number of output files + !> + !> @author J. Wang @date Jul, 2017 subroutine get_outfile(nfl, filename, outfile_name, noutfile) integer, intent(in) :: nfl character(*), intent(in) :: filename(:,:) @@ -4594,6 +4731,11 @@ subroutine get_outfile(nfl, filename, outfile_name, noutfile) end subroutine get_outfile + !> Trim the regridding interpolation method in a string suffix + !> + !> @param[in] string String with suffix + !> + !> @author J. Wang @date Jul, 2017 pure function trim_regridmethod_suffix(string) result(trimmed_string) character(len=*), intent(in) :: string character(len=:), allocatable :: trimmed_string @@ -4606,6 +4748,12 @@ pure function trim_regridmethod_suffix(string) result(trimmed_string) end function trim_regridmethod_suffix + !> Trim the suffix from a string + !> + !> @param[in] string String with suffix + !> @param[in] suffix Suffix string + !> + !> @author J. Wang @date Jul, 2017 pure function trim_suffix(string, suffix) result(trimmed_string) character(len=*), intent(in) :: string, suffix character(len=:), allocatable :: trimmed_string diff --git a/io/post_fv3.F90 b/io/post_fv3.F90 index a74e47670..bf74d4e32 100644 --- a/io/post_fv3.F90 +++ b/io/post_fv3.F90 @@ -1,3 +1,26 @@ +!> @file +!> @brief Run post on write grid comp. +!> @author Jun Wang @date Jul, 2019 + +!> @brief Run post on write grid comp. +!> +!> ## Module History +!> +!> Date | Programmer | Modification +!> -----|------------|------------- +!> Jul 2019 | J. Wang | create interface to run inline post for FV3 +!> Sep 2020 | J. Dong/J. Wang | create interface to run inline post for FV3-LAM +!> Apr 2021 | R. Sun | Added variables for Thomspon MP +!> Apr 2022 | W. Meng | 1)unify global and regional inline post interfaces +!> Apr 2022 | W. Meng | 2)add bug fix for dx/dy computation +!> Apr 2022 | W. Meng | 3)add reading pwat from FV3 +!> Apr 2022 | W. Meng | 4)remove some variable initializations +!> Apr 2022 | W. Meng | 5)read max/min 2m T from tmax_max2m/tmin_min2m for GFS, and from t02max/min for RRFS and HAFS. +!> Apr 2022 | W. Meng | 6)read 3D cloud fraction from cld_amt for GFDL MP, and from cldfra for other MPs. +!> Jun 2022 | J. Meng | 2D decomposition +!> Jul 2022 | W. Meng | 1)output lat/lon of four corner point for rotated lat-lon grid. 2)read instant model top logwave +!> +!> @author Jun Wang @date Jul, 2019 module post_fv3 use mpi_f08 @@ -10,35 +33,26 @@ module post_fv3 implicit none - public post_run_fv3 + public post_run_fv3 !< Interface to run inline post contains + !> Interface to run inline post. + !> + !> @param[in] wrt_int_state write grid component internal state. + !> @param[in] grid_id id number of the output grid. + !> @param[in] mype MPI rank. + !> @param[in] mpicomp MPI communicator of the write grid component. + !> @param[in] lead_write lead task of the write group. + !> @param[in] itasks number of MPI tasks in i direction of output domain. + !> @param[in] jtasks number of MPI tasks in j direction of output domain. + !> @param[in] mynfhr output forecast hours on the write grid component. + !> @param[in] mynfmin output forecast minutes on the write grid component. + !> @param[in] mynfsec output forecast secondson the write grid component. + !> + !> @author Jun Wang @date Jul, 2019 subroutine post_run_fv3(wrt_int_state,grid_id,mype,mpicomp,lead_write, & itasks,jtasks,mynfhr,mynfmin,mynfsec) -! -! revision history: -! Jul 2019 J. Wang create interface to run inline post for FV3 -! Sep 2020 J. Dong/J. Wang create interface to run inline post for FV3-LAM -! Apr 2021 R. Sun Added variables for Thomspon MP -! Apr 2022 W. Meng 1)unify global and regional inline post interfaces -! 2)add bug fix for dx/dy computation -! 3)add reading pwat from FV3 -! 4)remove some variable initializations -! 5)read max/min 2m T from tmax_max2m/tmin_min2m -! for GFS, and from t02max/min for RRFS -! and HAFS. -! 6)read 3D cloud fraction from cld_amt for GFDL MP, -! and from cldfra for other MPs. -! Jun 2022 J. Meng 2D decomposition -! Jul 2022 W. Meng 1)output lat/lon of four corner point for rotated -! lat-lon grid. -! 2)read instant model top logwave -! -!----------------------------------------------------------------------- -!*** run post on write grid comp -!----------------------------------------------------------------------- -! use ctlblk_mod, only : komax,ifhr,ifmin,modelname,datapd,fld_info, & npset,grib,jsta, & jend,ista,iend, im, nsoil, filenameflat,numx @@ -217,9 +231,13 @@ subroutine post_run_fv3(wrt_int_state,grid_id,mype,mpicomp,lead_write, & call post_finalize('grib2') end subroutine post_run_fv3 -! -!----------------------------------------------------------------------- -! + + !> Subroutine to get attributes for post processing. + !> + !> @param[in] wrt_int_state write grid component internal state. + !> @param[in] grid_id id number of the output grid. + !> + !> @author Jun Wang @date Jul, 2019 subroutine post_getattr_fv3(wrt_int_state,grid_id) ! use esmf @@ -488,9 +506,15 @@ subroutine post_getattr_fv3(wrt_int_state,grid_id) enddo !end nfb ! end subroutine post_getattr_fv3 -! -!----------------------------------------------------------------------- -! + + !> Subroutine to set post variables. + !> + !> @param[in] wrt_int_state write grid component internal state. + !> @param[in] grid_id id number of the output grid. + !> @param[in] mype MPI rank. + !> @param[in] mpicomp MPI communicator of the write grid component. + !> + !> @author Jun Wang @date Jul 2019 subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) ! ! revision history: diff --git a/io/post_nems_routines.F90 b/io/post_nems_routines.F90 index 337139b1d..8234a5c23 100644 --- a/io/post_nems_routines.F90 +++ b/io/post_nems_routines.F90 @@ -1,19 +1,35 @@ -!----------------------------------------------------------------------- -!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -!----------------------------------------------------------------------- -! - subroutine post_alctvars(imi,jmi,lmi,mype,nwtlpes,lead_write, mpicomp, & - jts,jte,jtsgrp,jtegrp,its,ite,itsgrp,itegrp) -! -! -! revision history: -! Jul 2019 Jun Wang: allocate arrays for post processing -! Feb 2022 J. Meng/B. Cui: create interface to run inline post with post_2d_decomp -! -!----------------------------------------------------------------------- -!*** allocate post variables -!----------------------------------------------------------------------- -! +!> @file +!> @brief Miscellaneous subroutines to support inline post. +!> @author Jun Wang @date Oct 8, 2019 + +!> Allocate post variables. +!> +!> ## Subroutine History +!> +!> Date | Programmer | Modification +!> -----|------------|------------- +!> Jul 2019 | Jun Wang | allocate arrays for post processing +!> Feb 2022 | J. Meng/B. Cui | create interface to run inline post with post_2d_decomp +!> +!> @param[in] imi i dimension size of the output grid. +!> @param[in] jmi j dimension size of the output grid. +!> @param[in] lmi l (layer) dimension size of the output grid. +!> @param[in] mype MPI rank. +!> @param[in] nwtlpes number of write tasks in the write group. +!> @param[in] lead_write lead task of the write group. +!> @param[in] mpicomp MPI communicator of the write grid component. +!> @param[in] jts start index in j dimention in a task subdomain. +!> @param[in] jte end index in j dimention in a task subdomain. +!> @param[in] jtsgrp start index in j dimention of all write tasks. +!> @param[in] jtegrp end index in j dimention of all write tasks. +!> @param[in] its start index in i dimention in a task subdomain. +!> @param[in] ite end index in j dimention in a task subdomain. +!> @param[in] itsgrp start index in i dimention of all write tasks. +!> @param[in] itegrp end idex in i dimention of all write tasks. +!> +!> @author Jun Wang @date Oct 8 2019 +subroutine post_alctvars(imi,jmi,lmi,mype,nwtlpes,lead_write, mpicomp, & + jts,jte,jtsgrp,jtegrp,its,ite,itsgrp,itegrp) use vrbls4d use vrbls3d use vrbls2d @@ -215,11 +231,18 @@ subroutine post_alctvars(imi,jmi,lmi,mype,nwtlpes,lead_write, mpicomp, & end do end do end subroutine post_alctvars -! -!--------------------------------------------------------------------- -!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& -!--------------------------------------------------------------------- -! + + !> Read post namelist. + !> + !> @param[in] kpo number of pressure levels. + !> @param[in] kth number of isentropic levels. + !> @param[in] kpv number of potential vorticity levels. + !> @param[in] po pressure levels to output. + !> @param[in] th isentropic levels to output. + !> @param[in] pv potential vorticity levels to output. + !> @param[in] post_namelist post namelist array. + !> + !> @author Jun Wang @date Jul 2019 subroutine read_postnmlt(kpo,kth,kpv,po,th,pv,post_namelist) ! use ctlblk_mod, only : komax,fileNameD3D,lsm,lsmp1,spl,spldef, & @@ -228,10 +251,6 @@ subroutine read_postnmlt(kpo,kth,kpv,po,th,pv,post_namelist) isf_surface_physics,modelname,submodelname,& rdaod,d2d_chem,nasa_on,gccpp_on use upp_ifi_mod, only: write_ifi_debug_files -! -! revision history: -! Jul 2019 Jun Wang: read post namelist -! implicit none !--- character (len=*), intent(in) :: post_namelist @@ -335,16 +354,13 @@ subroutine read_postnmlt(kpo,kth,kpv,po,th,pv,post_namelist) 1000 continue end subroutine read_postnmlt -! -!--------------------------------------------------------------------- -!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& -!--------------------------------------------------------------------- -! + + !> Finalize post step. + !> + !> @param[in] post_gribversion grib version(1 or 2) used in post. + !> + !> @author Jun Wang @date Jul 2019 subroutine post_finalize(post_gribversion) -! -! revision history: -! Jul 2019 Jun Wang: finalize post step -! use grib2_module, only : grib_info_finalize ! character(*),intent(in) :: post_gribversion