Skip to content

Commit a8990cf

Browse files
merged d6
2 parents 3529627 + 0641a5d commit a8990cf

File tree

2 files changed

+104
-64
lines changed

2 files changed

+104
-64
lines changed

io/post_fv3.F90

Lines changed: 54 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
!> @file
2+
!> @brief Run post on write grid comp.
3+
!> @author Jun Wang @date Jul, 2019
4+
5+
!> @brief Run post on write grid comp.
6+
!>
7+
!> ## Module History
8+
!>
9+
!> Date | Programmer | Modification
10+
!> -----|------------|-------------
11+
!> Jul 2019 | J. Wang | create interface to run inline post for FV3
12+
!> Sep 2020 | J. Dong/J. Wang | create interface to run inline post for FV3-LAM
13+
!> Apr 2021 | R. Sun | Added variables for Thomspon MP
14+
!> Apr 2022 | W. Meng | 1)unify global and regional inline post interfaces
15+
!> Apr 2022 | W. Meng | 2)add bug fix for dx/dy computation
16+
!> Apr 2022 | W. Meng | 3)add reading pwat from FV3
17+
!> Apr 2022 | W. Meng | 4)remove some variable initializations
18+
!> 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.
19+
!> Apr 2022 | W. Meng | 6)read 3D cloud fraction from cld_amt for GFDL MP, and from cldfra for other MPs.
20+
!> Jun 2022 | J. Meng | 2D decomposition
21+
!> Jul 2022 | W. Meng | 1)output lat/lon of four corner point for rotated lat-lon grid. 2)read instant model top logwave
22+
!>
23+
!> @author Jun Wang @date Jul, 2019
124
module post_fv3
225

326
use mpi
@@ -10,35 +33,26 @@ module post_fv3
1033

1134
implicit none
1235

13-
public post_run_fv3
36+
public post_run_fv3 !< Interface to run inline post
1437

1538
contains
1639

40+
!> Interface to run inline post.
41+
!>
42+
!> @param[in] wrt_int_state write grid component internal state.
43+
!> @param[in] grid_id id number of the output grid.
44+
!> @param[in] mype MPI rank.
45+
!> @param[in] mpicomp MPI communicator of the write grid component.
46+
!> @param[in] lead_write lead task of the write group.
47+
!> @param[in] itasks number of MPI tasks in i direction of output domain.
48+
!> @param[in] jtasks number of MPI tasks in j direction of output domain.
49+
!> @param[in] mynfhr output forecast hours on the write grid component.
50+
!> @param[in] mynfmin output forecast minutes on the write grid component.
51+
!> @param[in] mynfsec output forecast secondson the write grid component.
52+
!>
53+
!> @author Jun Wang @date Jul, 2019
1754
subroutine post_run_fv3(wrt_int_state,grid_id,mype,mpicomp,lead_write, &
1855
itasks,jtasks,mynfhr,mynfmin,mynfsec)
19-
!
20-
! revision history:
21-
! Jul 2019 J. Wang create interface to run inline post for FV3
22-
! Sep 2020 J. Dong/J. Wang create interface to run inline post for FV3-LAM
23-
! Apr 2021 R. Sun Added variables for Thomspon MP
24-
! Apr 2022 W. Meng 1)unify global and regional inline post interfaces
25-
! 2)add bug fix for dx/dy computation
26-
! 3)add reading pwat from FV3
27-
! 4)remove some variable initializations
28-
! 5)read max/min 2m T from tmax_max2m/tmin_min2m
29-
! for GFS, and from t02max/min for RRFS
30-
! and HAFS.
31-
! 6)read 3D cloud fraction from cld_amt for GFDL MP,
32-
! and from cldfra for other MPs.
33-
! Jun 2022 J. Meng 2D decomposition
34-
! Jul 2022 W. Meng 1)output lat/lon of four corner point for rotated
35-
! lat-lon grid.
36-
! 2)read instant model top logwave
37-
!
38-
!-----------------------------------------------------------------------
39-
!*** run post on write grid comp
40-
!-----------------------------------------------------------------------
41-
!
4256
use ctlblk_mod, only : komax,ifhr,ifmin,modelname,datapd,fld_info, &
4357
npset,grib,jsta, &
4458
jend,ista,iend, im, nsoil, filenameflat,numx
@@ -215,9 +229,13 @@ subroutine post_run_fv3(wrt_int_state,grid_id,mype,mpicomp,lead_write, &
215229
call post_finalize('grib2')
216230

217231
end subroutine post_run_fv3
218-
!
219-
!-----------------------------------------------------------------------
220-
!
232+
233+
!> Subroutine to get attributes for post processing.
234+
!>
235+
!> @param[in] wrt_int_state write grid component internal state.
236+
!> @param[in] grid_id id number of the output grid.
237+
!>
238+
!> @author Jun Wang @date Jul, 2019
221239
subroutine post_getattr_fv3(wrt_int_state,grid_id)
222240
!
223241
use esmf
@@ -485,9 +503,15 @@ subroutine post_getattr_fv3(wrt_int_state,grid_id)
485503
enddo !end nfb
486504
!
487505
end subroutine post_getattr_fv3
488-
!
489-
!-----------------------------------------------------------------------
490-
!
506+
507+
!> Subroutine to set post variables.
508+
!>
509+
!> @param[in] wrt_int_state write grid component internal state.
510+
!> @param[in] grid_id id number of the output grid.
511+
!> @param[in] mype MPI rank.
512+
!> @param[in] mpicomp MPI communicator of the write grid component.
513+
!>
514+
!> @author Jun Wang @date Jul 2019
491515
subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp)
492516
!
493517
! revision history:

io/post_nems_routines.F90

Lines changed: 50 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
1-
!-----------------------------------------------------------------------
2-
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3-
!-----------------------------------------------------------------------
4-
!
5-
subroutine post_alctvars(imi,jmi,lmi,mype,nwtlpes,lead_write, mpicomp, &
6-
jts,jte,jtsgrp,jtegrp,its,ite,itsgrp,itegrp)
7-
!
8-
!
9-
! revision history:
10-
! Jul 2019 Jun Wang: allocate arrays for post processing
11-
! Feb 2022 J. Meng/B. Cui: create interface to run inline post with post_2d_decomp
12-
!
13-
!-----------------------------------------------------------------------
14-
!*** allocate post variables
15-
!-----------------------------------------------------------------------
16-
!
1+
!> @file
2+
!> @brief Miscellaneous subroutines to support inline post.
3+
!> @author Jun Wang @date Oct 8, 2019
4+
5+
!> Allocate post variables.
6+
!>
7+
!> ## Subroutine History
8+
!>
9+
!> Date | Programmer | Modification
10+
!> -----|------------|-------------
11+
!> Jul 2019 | Jun Wang | allocate arrays for post processing
12+
!> Feb 2022 | J. Meng/B. Cui | create interface to run inline post with post_2d_decomp
13+
!>
14+
!> @param[in] imi i dimension size of the output grid.
15+
!> @param[in] jmi j dimension size of the output grid.
16+
!> @param[in] lmi l (layer) dimension size of the output grid.
17+
!> @param[in] mype MPI rank.
18+
!> @param[in] nwtlpes number of write tasks in the write group.
19+
!> @param[in] lead_write lead task of the write group.
20+
!> @param[in] mpicomp MPI communicator of the write grid component.
21+
!> @param[in] jts start index in j dimention in a task subdomain.
22+
!> @param[in] jte end index in j dimention in a task subdomain.
23+
!> @param[in] jtsgrp start index in j dimention of all write tasks.
24+
!> @param[in] jtegrp end index in j dimention of all write tasks.
25+
!> @param[in] its start index in i dimention in a task subdomain.
26+
!> @param[in] ite end index in j dimention in a task subdomain.
27+
!> @param[in] itsgrp start index in i dimention of all write tasks.
28+
!> @param[in] itegrp end idex in i dimention of all write tasks.
29+
!>
30+
!> @author Jun Wang @date Oct 8 2019
31+
subroutine post_alctvars(imi,jmi,lmi,mype,nwtlpes,lead_write, mpicomp, &
32+
jts,jte,jtsgrp,jtegrp,its,ite,itsgrp,itegrp)
1733
use vrbls4d
1834
use vrbls3d
1935
use vrbls2d
@@ -215,11 +231,18 @@ subroutine post_alctvars(imi,jmi,lmi,mype,nwtlpes,lead_write, mpicomp, &
215231
end do
216232
end do
217233
end subroutine post_alctvars
218-
!
219-
!---------------------------------------------------------------------
220-
!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
221-
!---------------------------------------------------------------------
222-
!
234+
235+
!> Read post namelist.
236+
!>
237+
!> @param[in] kpo number of pressure levels.
238+
!> @param[in] kth number of isentropic levels.
239+
!> @param[in] kpv number of potential vorticity levels.
240+
!> @param[in] po pressure levels to output.
241+
!> @param[in] th isentropic levels to output.
242+
!> @param[in] pv potential vorticity levels to output.
243+
!> @param[in] post_namelist post namelist array.
244+
!>
245+
!> @author Jun Wang @date Jul 2019
223246
subroutine read_postnmlt(kpo,kth,kpv,po,th,pv,post_namelist)
224247
!
225248
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)
228251
isf_surface_physics,modelname,submodelname,&
229252
rdaod,d2d_chem,nasa_on,gccpp_on
230253
use upp_ifi_mod, only: write_ifi_debug_files
231-
!
232-
! revision history:
233-
! Jul 2019 Jun Wang: read post namelist
234-
!
235254
implicit none
236255
!---
237256
character (len=*), intent(in) :: post_namelist
@@ -335,16 +354,13 @@ subroutine read_postnmlt(kpo,kth,kpv,po,th,pv,post_namelist)
335354
1000 continue
336355

337356
end subroutine read_postnmlt
338-
!
339-
!---------------------------------------------------------------------
340-
!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
341-
!---------------------------------------------------------------------
342-
!
357+
358+
!> Finalize post step.
359+
!>
360+
!> @param[in] post_gribversion grib version(1 or 2) used in post.
361+
!>
362+
!> @author Jun Wang @date Jul 2019
343363
subroutine post_finalize(post_gribversion)
344-
!
345-
! revision history:
346-
! Jul 2019 Jun Wang: finalize post step
347-
!
348364
use grib2_module, only : grib_info_finalize
349365
!
350366
character(*),intent(in) :: post_gribversion

0 commit comments

Comments
 (0)