Interoperable Physics Driver for NGGPS
gfs_physics_initialize_mod.f
Go to the documentation of this file.
1 #include "../../../ESMFVersionDefine.h"
2 
4 ! !module: gfs_physics_initialize_mod
8 !
9 ! !revision history:
10 !
11 ! november 2004 weiyu yang initial code.
12 ! january 2006 s. moorthi update to the new gfs version
13 ! august 2006 h. juang add option to run generalized coordinates
14 ! january 2007 h. juang change for dynamics only
15 ! july 2007 s. moorthi change for physics only
16 ! november 2007 h. juang continue for physics
17 ! may 2009 j. wang change for quilt
18 ! oct 09 2009 Sarah Lu coord def initialized (lats_nodes_r_fix,
19 ! lats_node_r, ipt_lats_node_r)
20 ! oct 11 2009 Sarah Lu grid_gr is replaced by grid_fld
21 ! oct 12 2009 Sarah Lu initialize start_step
22 ! oct 16 2009 Sarah Lu initialize gfs_phy_tracer
23 ! nov 14 2009 Sarah Lu flx_fld and sfc_fld allocation modified
24 ! dec 10 2009 Sarah Lu initialize lgocart and g3d_fld
25 ! jan 22 2010 Sarah Lu increase ngrids_flx and nfxr to include aod
26 ! feb 09 2010 Sarah Lu set tracer_const (ri,cpi) from import state
27 ! feb 05 2010 J. Wang put phy_f3d and phy_f2d into restart file
28 ! apr 09 2010 Sarah Lu initialize global_lats_r, lonsperlar
29 ! July 2010 S. Moorthi Upgrade to new physics + nst model
30 ! jul 14 2010 Sarah Lu initialize g2d_fld
31 ! jul 23 2010 Sarah Lu initialize ngrids_aer and buff_mult_pieceg
32 ! July 30 2010 S. Moorthi Removed allocation of cldcov
33 ! Aug 19 2010 S. Moorthi Updated for T574 + added num_reduce to namelist
34 ! Oct 18 2010 S. Moorthi Added fscav initialization
35 ! Dec 23 2010 Sarah Lu initialize scatter_lats, scatter_lons, g2d_fld%met
36 ! Mar 27 2010 J. Wang add zsoil to sfc file
37 ! Oct 03 2011 W. Yang Modified for using the ESMF 5.2.0r library.
38 ! Apr 06 2012 H. Juang add idea
39 ! Aug 20 2013 S. Moorthi Updating for YuTai's new radiation package in gfs
40 ! Nov 23 2013 Sarah Lu specify climate in internal state from namelist
41 ! Mar 18 2014 Sarah Lu Remove iaer_mdl in rad_init
42 ! Mar 25 2014 Xingren Wu initialize aoi_fld
43 ! Mar 31 2014 S. Moorthi Allocate and Initialize the array sstForGSM
44 ! Jun 26 2014 S. Moorthi Modified to read lonsperlar from a file
45 ! Jul 11 2014 S. Moorthi Add npdf3d for pdf clouds
46 ! Jul 18 2014 S. Moorthi removed num_reduce
47 ! Sep 30 2014 Sarah Lu Remove fscav initialization
48 ! Nov 17 2014 S. Moorthi Add missing dxmin, dxmax and dxinv definitions (my error)
49 ! Feb 05 2015 s. moorthi several changes including stochphys switch to reduce memory
50 ! Apr 09 2015 s. moorthi cs convection related change
51 ! Jun 09 2015 G Theurich Generalize importData handling
52 ! aug 2015 s. moorthi implement SHOC related additions
53 ! Aug 10 2015 s. moorthi add call to sfc_init
54 ! Aug 21 2015 Xu Li change nst_fcst to be nstf_name
55 ! Jan 2016 P. Tripp NUOPC/GSM merge - importData
56 ! March 2016 J. Han Add ncnvcld3d for enhancing conv clouds
57 ! March 2016 Hang Lei Initialize the physics variable for mdl_parm
58 ! May 03 2016 S Moorthi add ntiw, ntlnc, ntinc, nto, nto2
59 ! jun 10 2016 S Moorthi add stratospheric h2o parameterization
60 ! June 2016 Xu Li add call nst_init
61 ! July 14 2016 S Moorthi add mg_dcs and mg_qcvar, mg_ts_auto_ice
62 ! July 22 2016 Hang Lei add ozoneini and h2oini for physics driver
63 ! !interface:
64 !
66 
67 !
68 !!uses:
69 !
70  USE esmf
71  USE gfs_physics_internal_state_mod, ONLY: gfs_physics_internal_state
74  h2oini
75 ! USE mpi_def, ONLY: liope
76  USE mpi_def, ONLY: mc_comp, mc_io, mpi_comm_all_dup, mpi_comm_all
77  USE resol_def, ONLY: g_dpdt, lotgr, g_p, g_dp, nrcm, g_q, &
78  g_gz, g_u, g_v, g_ps, g_t, ntoz, &
79  ntcw, lonr, latr, ncld, num_p3d, num_p2d,npdf3d,&
80  ncnvcld3d,lsoil,nmtvr,levr,nlunit, ntrac, nxpt, &
81  jcap, levs, nypt, jintmx, ngrids_sfcc, &
82 !jw
83  ngrids_sfcc2d,ngrids_sfcc3d, & !jwang
84  ngrids_aer, & !sarah lu
85  ngrids_aoi, & !xwu
86  ngrids_flx, levp1, lonrx, nfxr, ngrids_gg, &
87  levm1, ivssfc, thermodyn_id, sfcpress_id, &
88  ivssfc_restart, latrd, latr2, ivsupa, levh, &
89  lgocart, scatter_lats, scatter_lons, &
90  nr_nst, nf_nst, ngrids_nst, ivsnst, &
91  nshoc_3d, nshoc_2d, ntke, ntot3d, ntot2d, &
92  ntiw, ntlnc, ntinc, nto, nto2
93 !jw
94  use mod_state, ONLY: buff_mult_piecea2d,buff_mult_piecea3d, & !jwang
95  buff_mult_piecef,buff_mult_pieceg, &
96  buff_mult_piecenst
97  use coordinate_def, ONLY: ak5,bk5,ck5 !jwang
98  use vert_def, only: sl,si ! Moorthi
99 
100  USE ozne_def, ONLY: levozc, latsozp, blatc, timeozc, timeoz, &
101  kozpl, levozp, pl_time, pl_lat, pl_pres, &
102  kozc, dphiozc, latsozc, pl_coeff
103  use h2o_def, only: levh2o, latsh2o, h2o_lat, h2o_pres, h2o_time, &
104  h2o_coeff, kh2opltc, timeh2o
105  USE namelist_physics_def, &
106  only: ras, cscnv, jo3, ldiag3d, ngptc, ens_nam, &
107  reduced_grid, grid_aldata, nstf_name, &
108  isol, ico2, ialb,iems, isot,ivegsrc,iaer, &
109  iovr_sw,iovr_lw,ictm, isubc_sw,isubc_lw, &
110  use_nuopc,crick_proof, ccnorm, norad_precip, &
111  hybrid, gen_coord_hybrid, climate, &
112  a2oi_out, cplflx, stochphys, do_shoc, &
113 ! Add some things needed by physics wrapper
114  flipv, pre_rad, lsm, imfshalcnv,imfdeepcnv, &
115  ncw, crtrh, cdmbgwd, ccwf, dlqf, ctei_rm, cgwf, &
116  prslrd0, ral_ts,old_monin, cnvgwd, shal_cnv, &
117  cal_pre, mom4ice, mstrat, trans_trac, moist_adj,&
118  lsidea, pdfcld, shcnvcw, redrag, hybedmf, &
119  dspheat, shoc_cld, shocaftcnv,nemsio_in, &
120  h2o_phys, mg_dcs, mg_qcvar, mg_ts_auto_ice
121 
122  USE module_ras, ONLY: nrcmax, fix_ncld_hr
123  use cs_conv , only: nctp
124  use physcons, only: max_lon, max_lat, min_lon, min_lat, dxmin, dxmax, dxinv
125 
126  USE gg_def, ONLY: sinlat_r, coslat_r, wgtcs_r, rcs2_r, wgt_r, &
127  colrad_r
128  USE layout1, ONLY: nodes_comp, lats_node_r_max, lats_node_r, &
129  nodes, lon_dims_ext, lon_dims_r,idrt, &
130  ipt_lats_node_r, me, comp_task
131  USE date_def, ONLY: idate, fhour
132 !* USE tracer_const, ONLY: set_tracer_const
133 
134  USE gfs_physics_sfc_flx_set_mod, &
135  only: sfcvar_aldata, flxvar_aldata, flx_init, sfc_init
136  USE d3d_def, ONLY: d3d_init, d3d_zero
137  use machine, ONLY : kind_io4
138  USE sfcio_module, ONLY: sfcio_axdbta
139 
140  USE gfs_physics_gridgr_mod, ONLY: gridvar_aldata
141  USE gfs_physics_g3d_mod, ONLY: g3d_aldata
142  USE gfs_physics_g2d_mod, ONLY: g2d_aldata
143  use gfs_phy_tracer_config, ONLY: gfs_phy_tracer, tracer_config_init
144  use gfs_physics_nst_var_mod, ONLY: nstvar_aldata, nst_init
145  use module_radsw_parameters, only: nbdsw
146  use module_radlw_parameters, only: nbdlw
147  use cldwat2m_micro, only: ini_micro ! initialize MG microphys
148  use aer_cloud, only: aer_cloud_init
149  use gfs_physics_aoi_var_mod
150  use module_cplfields, only: nimportfields
151 !#ifndef IBM
152 ! USE omp_lib
153 !#endif
154  implicit none
155 
156  include 'mpif.h'
157 
158  contains
159 
160  subroutine gfs_physics_initialize(gis_phy, rc)
162 ! this subroutine sets up the internal state variables,
163 ! allocate internal state arrays for initializing the gfs system.
164 !----------------------------------------------------------------
165 
166  integer, parameter :: iunit=101
167  type(gfs_physics_internal_state), pointer, intent(inout) :: gis_phy
168  integer, intent(out) :: rc
169 
170  integer :: ierr
171 
172  integer :: i, j, k, l, n, ilat, locl, ikey,&
173  nrank_all,nblck,latrhf,iret
174  integer :: num_parthds
175  logical :: file_exists=.false.
176 !!
177  real (kind=kind_io4) blatc4
178  real (kind=kind_io4), allocatable, dimension(:) :: pl_lat4, pl_pres4, &
179  pl_time4, h2o_lat4, h2o_pres4, h2o_time4
180 
181  real (kind=kind_phys), allocatable :: si_loc(:)
182 !
183  real (kind=kind_phys), parameter :: typical_pgr=95.0
184 ! integer, parameter :: iflip = 0 ! virtical profile index from toa
185  ! to sfc
186  integer, parameter :: iflip = 1 ! virtical profile index from sfc
187  ! to toa
188  real (kind=8) :: phys_ini_time=0, btime, timef
189 !!
190 ! include 'function2'
191 !!
192  btime = timef()
193 
194 ! set up gfs internal state (gis_phy) dimension and values for physics etc
195 !-------------------------------------------------------------------
196  me = gis_phy%me
197  nodes = gis_phy%nodes
198 ! CALL ESMF_VMGetCurrent(vm, rc = ierr)
199 
200  call compns_physics(gis_phy%deltim, gis_phy%iret, gis_phy%ntrac, &
201  gis_phy%nxpt, gis_phy%nypt, gis_phy%jintmx,&
202  gis_phy%jcap, gis_phy%levs, gis_phy%levr, &
203  gis_phy%lonr, gis_phy%latr, &
204  gis_phy%ntoz, gis_phy%ntcw, gis_phy%ncld, &
205  gis_phy%ntiw, gis_phy%ntlnc, gis_phy%ntinc, &
206  gis_phy%nto, gis_phy%nto2, &
207  gis_phy%ntke, gis_phy%lsoil, gis_phy%nmtvr,&
208  gis_phy%num_p3d, gis_phy%num_p2d, &
209  gis_phy%npdf3d, gis_phy%ncnvcld3d, &
210  gis_phy%nshoc_3d, gis_phy%nshoc_2d, &
211  gis_phy%ntot3d, gis_phy%ntot2d, &
212  gis_phy%thermodyn_id, gis_phy%sfcpress_id, &
213  gis_phy%nam_gfs_phy%nlunit, me, &
214  gis_phy%nam_gfs_phy%gfs_phy_namelist)
215 
216 ! if (me == 0) write(0,*)' after compns_physics ntke=', gis_phy%ntke
217 !
218 ! This is also called in nuopc_phys_init, don't run twice if using the wrapper
219 ! if ( .not. use_nuopc ) then
220 ! use isot/ivegsrc to determine the new or old veg/soil type data
221  CALL set_soilveg(me,isot,ivegsrc,gis_phy%nam_gfs_phy%nlunit)
222 ! end if
223 !* ri/cpi is filled from dyn export state attributes (Sarah Lu)
224 !* call set_tracer_const(gis_phy%ntrac,me,gis_phy%nam_gfs_phy%nlunit)
225 !
226 ! met+chem tracer specification (Sarah Lu)
227 ! NOTE: This config_init call repeats the init routine in dyc gc.
228 ! The redundant calls will be removed in a later revision.
229 ! The tracer specification will then be passed in from dyn dc
230 !
231 ! call tracer_config_init( gis_phy%gfs_phy_tracer, gis_phy%ntrac, &
232  call tracer_config_init( gis_phy%ntrac, gis_phy%ntoz, &
233  gis_phy%ntcw, gis_phy%ncld, &
234  gis_phy%ntiw, gis_phy%ntlnc, &
235  gis_phy%ntinc, gis_phy%ntke, &
236  gis_phy%nto, gis_phy%nto2, me )
237 ! gfs_phy_tracer = gis_phy%gfs_phy_tracer
238  gis_phy%lgocart = gfs_phy_tracer%doing_GOCART ! for internal state
239  lgocart = gis_phy%lgocart ! for resol_def module
240  if( me == 0) then
241  write(0,*)'LU_TRC, ntrac =',gfs_phy_tracer%ntrac, gis_phy%ntrac
242  write(0,*)'LU_TRC, ntrac_met =',gfs_phy_tracer%ntrac_met
243  write(0,*)'LU_TRC, ntrac_chem=',gfs_phy_tracer%ntrac_chem
244  write(0,*)'LU_TRC, lgocart =',gis_phy%lgocart,lgocart
245  do n = 1, gfs_phy_tracer%ntrac
246  write(0,*)'LU_TRC, tracer_vname=',gfs_phy_tracer%vname(n)
247  enddo
248  endif
249 
250 !
251  nlunit = gis_phy%nam_gfs_phy%nlunit
252  ntrac = gis_phy%ntrac
253  nxpt = gis_phy%nxpt
254  nypt = gis_phy%nypt
255  jintmx = gis_phy%jintmx
256  jcap = gis_phy%jcap
257  levs = gis_phy%levs
258  levr = gis_phy%levr
259  lonr = gis_phy%lonr
260  latr = gis_phy%latr
261  ntoz = gis_phy%ntoz
262  ntcw = gis_phy%ntcw
263  ncld = gis_phy%ncld
264  ntiw = gis_phy%ntiw
265  ntlnc = gis_phy%ntlnc
266  ntinc = gis_phy%ntinc
267  nto = gis_phy%nto
268  nto2 = gis_phy%nto2
269  ntke = gis_phy%ntke
270  lsoil = gis_phy%lsoil
271  nmtvr = gis_phy%nmtvr
272  num_p3d = gis_phy%num_p3d
273  num_p2d = gis_phy%num_p2d
274  npdf3d = gis_phy%npdf3d
275  ncnvcld3d = gis_phy%ncnvcld3d
276  nshoc_3d = gis_phy%nshoc_3d
277  nshoc_2d = gis_phy%nshoc_2d
278  ntot3d = gis_phy%ntot3d
279  ntot2d = gis_phy%ntot2d
280  thermodyn_id = gis_phy%thermodyn_id
281  sfcpress_id = gis_phy%sfcpress_id
282  if (gis_phy%nam_gfs_phy%Total_Member <= 1) then
283  ens_nam=' '
284  else
285  write(ens_nam,'("_",I2.2)') gis_phy%nam_gfs_phy%Member_Id
286  endif
287 !
288 ! ivssfc = 200501
289  ivssfc = 200509
290  ivssfc_restart = 200509
291  if (ivssfc > ivssfc_restart) ivssfc_restart = ivssfc
292  ivsnst = 200907
293 !
294  allocate(gis_phy%zsoil(lsoil))
295  if(lsoil == 2) then
296  gis_phy%zsoil = (/-0.1,-2.0/)
297  elseif(lsoil == 4) then
298  gis_phy%zsoil = (/-0.1,-0.4,-1.0,-2.0/)
299  endif
300 
301  ivsupa = 0
302  if (levs > 99) ivsupa = 200509
303 !
304  levh = ntrac*levs
305  latrd = latr + 2*jintmx
306  latr2 = latr/2
307  levm1 = levs-1
308  levp1 = levs+1
309  lonrx = lonr + 1 + 2*nxpt + 1
310 !
311  ngrids_sfcc = 32+lsoil*3 ! No CV, CVB, CVT! includes T2M, Q2M, TISFC
312 !jw
313  ngrids_sfcc2d = 32 ! No CV, CVB, CVT! includes T2M, Q2M, TISFC
314  ngrids_sfcc3d = lsoil*3 ! for smc,stc,slc
315 
316  gis_phy%climate = climate
317  if (climate) then
318 ! ngrids_flx = 66+36+8 ! additional 8 gocart avg output fields
319 ! ngrids_flx = 66+36+8+4! additional 8 gocart, 4 sw fluxes
320  ngrids_flx = 66+36+5 ! additional 4 sw fluxes + frozen precip fraction
321  else
322 ! ngrids_flx = 66+43+8 ! additional 8 gocart avg output fields
323 ! ngrids_flx = 66+43+8+4! additional 8 gocart, 4 sw fluxes
324  ngrids_flx = 66+43+5 ! additional 4 sw fluxes + frozen precip fraction
325  endif
326 
327  nfxr = 39 ! Add AOD
328  ngrids_gg = 2+levs*(4+ntrac)
329 !
330  ngrids_aoi = 40
331 !
332  if (nstf_name(1) > 0) then ! For NST model
333 ! ngrids_nst = 19 ! oceanic fields (for diurnal warming and sub-layer)
334  nr_nst = 10 ! oceanic fields: for diurnal warming modelrun
335  nf_nst = 9 ! oceanic fields: for GSI analysis
336  ngrids_nst = nr_nst + nf_nst ! oceanic fields (for diurnal warming and sub-layer)
337  else
338  ngrids_nst = 0
339  endif
340 !
341  allocate(ak5(levp1))
342  allocate(bk5(levp1))
343  allocate(ck5(levp1))
344  allocate(si(levp1))
345  allocate(sl(levs))
346 
347  allocate ( lon_dims_r(latr), stat = ierr )
348  allocate ( lon_dims_ext(latrd), stat = ierr )
349 !
350  allocate(colrad_r(latr), stat = ierr)
351  allocate(wgt_r(latr2), stat = ierr)
352  allocate(wgtcs_r(latr2), stat = ierr)
353  allocate(rcs2_r(latr2), stat = ierr)
354  allocate(sinlat_r(latr), stat = ierr)
355  allocate(coslat_r(latr), stat = ierr)
356 !
357  allocate ( gis_phy%lats_nodes_r(nodes), stat = ierr )
358  allocate ( gis_phy%lats_nodes_ext(nodes), stat = ierr )
359  allocate ( gis_phy%global_lats_r(latr), stat = ierr )
360  allocate ( gis_phy%global_lats_ext(latr), stat = ierr )
361  allocate ( gis_phy%lonsperlar(latr), stat = ierr)
362  allocate ( gis_phy%lats_nodes_r_fix(nodes), stat = ierr ) !added for mGrid
363 ! allocate ( gis_phy%global_lats_ext(latr+2*jintmx+2*nypt*(nodes-1)), stat = ierr )
364 
365  if (me == 0) write(0,*)' in gfs_physics_initialize reduced_grid=',reduced_grid
366 
367  if( reduced_grid ) then
368  if (me == 0) print *,' run with reduced gaussian grid '
369  inquire (file="lonsperlar.dat", exist=file_exists)
370  if ( .not. file_exists ) then
371  if ( me == 0 ) then
372  print *,' Requested lonsperlar.dat data file does not exist'
373  print *,' *** Stopped in subroutine GFS_Init !!'
374  endif
375  call mpi_quit(1111)
376  else
377  open (iunit,file='lonsperlar.dat',status='old',form='formatted', &
378  action='read',iostat=iret)
379  if (iret /= 0) then
380  write(0,*)' iret while reading lonsperlar.dat ',iret
381  call mpi_quit(1112)
382  endif
383  rewind iunit
384  read (iunit,*,iostat=iret) latrhf,(gis_phy%lonsperlar(i),i=1,latrhf)
385  if (latrhf+latrhf /= latr) then
386  write(0,*)' latrhf=',latrhf,' not equal to latr/2=',latr/2
387  call mpi_quit(1113)
388  endif
389  do i=1,latrhf
390  gis_phy%lonsperlar(latr-i+1) = gis_phy%lonsperlar(i)
391  enddo
392  close(iunit)
393  endif
394 ! write(0,*)' gis_phy%lonsperlar=',gis_phy%lonsperlar
395  else
396  if (me == 0) print *,' run with full gaussian grid '
397  do j=1,latr
398  gis_phy%lonsperlar(j) = lonr
399  enddo
400  endif
401 !
402  g_gz = 1
403  g_ps = g_gz + 1
404  g_t = g_ps + 1
405  g_u = g_t + levs
406  g_v = g_u + levs
407  g_q = g_v + levs
408  g_p = g_q + levh
409  g_dp = g_p + levs
410  g_dpdt = g_dp + levs
411 
412  lotgr = g_dpdt+ levs - 1
413 
414  gis_phy%g_gz = g_gz
415  gis_phy%g_ps = g_ps
416  gis_phy%g_t = g_t
417  gis_phy%g_u = g_u
418  gis_phy%g_v = g_v
419  gis_phy%g_q = g_q
420  gis_phy%g_p = g_p
421  gis_phy%g_dp = g_dp
422  gis_phy%g_dpdt = g_dpdt
423 !
424  gis_phy%lotgr = lotgr
425 
426 
427  if (ras) then
428  if (fix_ncld_hr) then
429  nrcm = min(nrcmax, levs-1) * (gis_phy%deltim/1200) + 0.10001
430  else
431  nrcm = min(nrcmax, levs-1)
432  endif
433  else
434  nrcm = 2
435  endif
436 !
437 ! write(0,*)' before ozone read'
438  if (ntoz <= 0) then ! Diagnostic ozone
439  rewind(kozc)
440  read (kozc,end=101) latsozc, levozc, timeozc, blatc4
441  101 if (levozc < 10 .or. levozc > 100) then
442  rewind(kozc)
443  levozc = 17
444  latsozc = 18
445  blatc = -85.0
446  else
447  blatc = blatc4
448  endif
449  latsozp = 2
450  levozp = 1
451  timeoz = 1
452  pl_coeff = 0
453  else ! Prognostic Ozone
454  rewind(kozpl)
455  read (kozpl) pl_coeff, latsozp, levozp, timeoz
456  allocate (pl_lat(latsozp), pl_pres(levozp),pl_time(timeoz+1), stat = ierr)
457  allocate (pl_lat4(latsozp), pl_pres4(levozp),pl_time4(timeoz+1), stat = ierr)
458  rewind(kozpl)
459  read (kozpl) pl_coeff, latsozp, levozp, timeoz, pl_lat4, pl_pres4, &
460  pl_time4
461  pl_pres(:) = pl_pres4(:)
462  pl_lat(:) = pl_lat4(:)
463  pl_time(:) = pl_time4(:)
464  latsozc = 2
465  blatc = 0.0
466  if (allocated(pl_lat4)) deallocate(pl_lat4)
467  if (allocated(pl_pres4)) deallocate(pl_pres4)
468  if (allocated(pl_time4)) deallocate(pl_time4)
469  endif
470  dphiozc = -(blatc+blatc)/(latsozc-1)
471 !
472  if (me == 0) then
473 
474 ! print *,' g_gz ',g_gz
475 ! print *,' g_ps ',g_ps
476 ! print *,' g_t ',g_t
477 ! print *,' g_u ',g_u
478 ! print *,' g_v ',g_v
479 ! print *,' g_q ',g_q
480 ! print *,' g_p ',g_p
481 ! print *,' g_dp ',g_dp
482 ! print *,' g_dpdt ',g_dpdt
483 ! print *,' lotgr ',lotgr
484  print *,' latsozp=',latsozp,' levozp=',levozp,' timeoz=',timeoz
485  print *,' latsozc=',latsozc,' levozc=',levozc,' timeozc=', &
486  timeozc, 'dphiozc=',dphiozc
487 ! print *,' pl_lat=',pl_lat
488 ! print *,' pl_pres=',pl_pres
489 ! print *,' pl_time=',pl_time
490 
491  endif
492 
493 ! pl_pres(:) = log(0.1*pl_pres(:)) ! Natural log of pres in cbars
494  pl_pres(:) = log(100.0*pl_pres(:)) ! Natural log of pres in Pa
495 !
496  allocate(gis_phy%OZPLIN(latsozp,levozp,pl_coeff,timeoz), stat = ierr) !OZONE P-L coeffcients
497 
498 
499 !
500 ! Read water vapor PL, TEFF and CLM
501 !
502  if (h2o_phys) then
503  rewind(kh2opltc)
504  read (kh2opltc) h2o_coeff, latsh2o, levh2o, timeh2o
505  allocate (h2o_lat(latsh2o), h2o_pres(levh2o), h2o_time(timeh2o+1))
506  allocate (h2o_lat4(latsh2o), h2o_pres4(levh2o), h2o_time4(timeh2o+1))
507  rewind(kh2opltc)
508  read (kh2opltc) h2o_coeff, latsh2o, levh2o, timeh2o, h2o_lat4, &
509  h2o_pres4, h2o_time4
510  h2o_pres(:) = h2o_pres4(:)
511  h2o_lat(:) = h2o_lat4(:)
512  h2o_time(:) = h2o_time4(:)
513  if (me == 0) then
514  print *,' h2o_coeff=',h2o_coeff
515  print *,' latsh2o=',latsh2o,' levh2o=',levh2o,' timeh2o=',timeh2o
516  print *,' h2o_lat=',h2o_lat
517  print *,' h2o_pres=',h2o_pres
518  print *,' h2o_time=',h2o_time
519  endif
520  h2o_pres(:) = log(100.0*h2o_pres(:)) ! Natural log of pres in Pa
521 !
522  allocate(gis_phy%H2OPLIN(latsh2o,levh2o,h2o_coeff,timeh2o)) ! H2O P-L, TEFF and CLIMO coeffcients
523  deallocate (h2o_lat4, h2o_pres4, h2o_time4)
524  else
525  latsh2o = 1 ; levh2o = 1 ; timeh2o = 1 ; h2o_coeff = 1
526  allocate (h2o_lat(latsh2o), h2o_pres(levh2o), h2o_time(timeh2o+1))
527  allocate(gis_phy%H2OPLIN(latsh2o,levh2o,h2o_coeff,timeh2o)) ! H2O P-L, TEFF and CLIMO coeffcients
528  endif
529 
530 !
531 ! Compute dxmax, dxmin, and dxinv used in gbphys and grrad
532 !
533  dxmax = log(1.0/(max_lon*max_lat))
534  dxmin = log(1.0/(min_lon*min_lat))
535  dxinv = 1.0 / (dxmax-dxmin)
536  if (me == 0) write(0,*)' dxmax=',dxmax,' dxmin=',dxmin,' dxinv=',dxinv
537 
538 ! write(0,*)' finished array allocation in gfs_physics_initialize '
539 
540 !
541 !@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
542 !!
543 !! create io communicator and comp communicator
544 !!
545 ! if (me == 0) write(*,*) 'io option ,liope :',liope
546 !
547 !jw call mpi_comm_dup(mpi_comm_all, mpi_comm_all_dup, ierr)
548 ! call mpi_barrier (mpi_comm_all_dup, ierr)
549 !
550 ! if (nodes == 1) liope=.false.
551 !jw if (liope) then
552 !jw call mpi_comm_rank(mpi_comm_all_dup,nrank_all,ierr)
553 !jw icolor=1
554 !jw ikey=1
555 !jw nodes_comp=nodes-1
556 !jw if (nrank_all.eq.nodes-1) then
557 !! io server
558 !jw write(*,*) 'io server task'
559 !jw icolor=2
560 !jw gis_phy%kcolor=mpi_undefined
561 !jw call mpi_comm_split(mpi_comm_all_dup,icolor,ikey,mc_io,ierr)
562 !jw call mpi_comm_split(mpi_comm_all_dup,gis_phy%kcolor,ikey,mc_comp,ierr)
563 !jw else
564 !sela write(*,*) 'compute server task '
565 !jw icolor=mpi_undefined
566 !jw gis_phy%kcolor=1
567 !jw call mpi_comm_split(mpi_comm_all_dup,gis_phy%kcolor,ikey,mc_comp,ierr)
568 !jw call mpi_comm_split(mpi_comm_all_dup,icolor,ikey,mc_io,ierr)
569 !jw call mpi_comm_size(mc_comp,nodes,ierr)
570 !jw endif
571 !jw else
572 !jw icolor=2
573 !jw mc_comp=mpi_comm_all_dup
574 !jw endif
575 !@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
576 !!
577  nodes_comp = nodes
578  comp_task = me < nodes_comp
579 !c
580 !$$$ time0=timer()
581 !
582  if (me == 0) then
583 ! print 100, jcap,levs
584 !100 format (' smf ',i3,i3,' in gfs physics initialize ')
585 !#ifdef IBM
586  print*,'number of threads is ',num_parthds()
587 !#else
588 ! print*,'number of threads is ',omp_get_num_threads()
589 !#endif
590 !jw if (liope) then
591 !jw print*,'number of mpi procs is ',nodes
592 !jw print*,'number of mpi io procs is 1 (nodes)'
593 !jw else
594  print*,'number of mpi procs is ',nodes
595 !jw endif
596  endif
597 !c
598  gis_phy%cons0 = 0.0d0
599  gis_phy%cons0p5 = 0.5d0
600  gis_phy%cons1200 = 1200.d0
601  gis_phy%cons3600 = 3600.d0
602 !!
603 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
604 !
605 !
606  if(gis_phy%iret.ne.0) then
607  if(me == 0) print *,' incompatible physics namelist -', &
608  ' aborted in gfs_phy_initilize ',gis_phy%iret
609 !* ' aborted in gfs_phy_initilize'
610  call mpi_quit(13)
611  endif
612 !!
613 ! if predicted ozon is desired set jo3=2
614  jo3 = 2 !using predicted ozone in radiation.
615 !
616  gis_phy%lats_nodes_ext = 0
617 
618 ! write(0,*)' gis_phy%lonsperlar2d=',gis_phy%lonsperlar
619  call getcon_physics(gis_phy%n3,gis_phy%n4, &
620  gis_phy%lats_nodes_r,gis_phy%global_lats_r, &
621  gis_phy%lonsperlar, &
622  gis_phy%lats_nodes_ext,gis_phy%global_lats_ext,&
623  gis_phy%colat1,gis_phy%idrt)
624 
625  idrt = gis_phy%idrt
626 
627 ! write(0,*)' gis_phy%lonsperlar2c=',gis_phy%lonsperlar
628 
629  gis_phy%lats_node_r_max = lats_node_r_max
630  gis_phy%lats_nodes_r_fix(:) = gis_phy%lats_node_r_max
631 
632 !* set up scatter_lats and scatter_lons for simple scatter (Sarah Lu)
633  allocate(scatter_lats(latr))
634  allocate(scatter_lons(latr))
635  scatter_lats(1:latr) = gis_phy%global_lats_r(1:latr)
636  scatter_lons(1:latr) = gis_phy%lonsperlar(1:latr)
637 
638 !* change lats_node_r to lats_node_r_max to allow the pointer option
639 !* call sfcvar_aldata(lonr, lats_node_r, lsoil, gis_phy%sfc_fld, ierr)
640 !* call flxvar_aldata(lonr, lats_node_r, gis_phy%flx_fld, ierr)
641 
642  call sfcvar_aldata(lonr, lats_node_r_max, lsoil, gis_phy%sfc_fld, ierr)
643  call sfc_init(gis_phy%sfc_fld, ierr)
644  call flxvar_aldata(lonr, lats_node_r_max, gis_phy%flx_fld, ierr)
645 
646 ! print *,' check after sfc flx var_aldata '
647  IF (me == 0) write(*,*) ' in "GFS_Initialize_ESMFMod,lonr,lats_node_r,&
648  nr_nst,nf_nst : ',lonr,lats_node_r,nr_nst,nf_nst, &
649  'lats_node_r_max=',lats_node_r_max
650 
651 ! write(0,*)'in GFS_Initialize_ESMFMod,lonr=',lonr,'lats_node_r=', &
652 ! lats_node_r,'nr_nst=',nr_nst,' nf_nst=',nf_nst, &
653 ! 'lats_node_r_max=',lats_node_r_max
654 
655 ! Modified by Moorthi
656 
657  if (nstf_name(1) > 0) then
658  call nstvar_aldata(lonr,lats_node_r_max,gis_phy%nst_fld,ierr)
659  call nst_init(gis_phy%nst_fld, ierr)
660  endif
661 
662 ! Add (Xingren Wu)
663  if (a2oi_out .or. cplflx) then
664  call aoivar_aldata(lonr,lats_node_r_max,gis_phy%aoi_fld,ierr)
665  endif
666 
667 !! allocate grid_fld --- Sarah Lu
668  gis_phy%grid_aldata = grid_aldata
669  if ( gis_phy%grid_aldata ) then
670  if( me == 0) print *,'LU_PHY: grid_fld allocated ; copy is used' &
671  ,' gis_phy%ntrac=',gis_phy%ntrac
672  call gridvar_aldata (lonr, lats_node_r_max, levs, &
673  gis_phy%ntrac, gis_phy%grid_fld, ierr)
674  else
675  allocate (gis_phy%grid_fld%rqtk(lonr,lats_node_r_max))
676  if( me == 0) print *,'LU_PHY: grid_fld not allocated ; pointer is used'
677  endif
678 
679 !* allocate (gis_phy%grid_gr(lonr*lats_node_r_max,lotgr), stat = ierr )
680 !* ALLOCATE (gis_phy%CLDCOV(LEVS,LONR,LATS_NODE_R), stat = ierr)
681 ! ALLOCATE (gis_phy%CLDCOV(LEVS,LONR,LATS_NODE_R_MAX), stat = ierr)
682 
683  ALLOCATE (gis_phy%XLON(lonr,lats_node_r), stat = ierr)
684  ALLOCATE (gis_phy%XLAT(lonr,lats_node_r), stat = ierr)
685  ALLOCATE (gis_phy%COSZDG(lonr,lats_node_r), stat = ierr)
686  ALLOCATE (gis_phy%SFALB(lonr,lats_node_r), stat = ierr)
687  ALLOCATE (gis_phy%HPRIME(nmtvr,lonr,lats_node_r), stat = ierr)
688  ALLOCATE (gis_phy%FLUXR(nfxr,lonr,lats_node_r), stat = ierr)
689 
690  ALLOCATE (gis_phy%importData(lonr,lats_node_r,nimportfields),stat = ierr)
691  gis_phy%importData = -99999.0
692 
693  nblck = lonr/ngptc + 1
694  gis_phy%NBLCK = nblck
695 
696  ALLOCATE (gis_phy%SWH(ngptc,levs,nblck,lats_node_r), stat = ierr)
697  ALLOCATE (gis_phy%HLW(ngptc,levs,nblck,lats_node_r), stat = ierr)
698 ! if (stochphys) then
699  ALLOCATE (gis_phy%SWHC(ngptc,levs,nblck,lats_node_r), stat = ierr)
700  ALLOCATE (gis_phy%HLWC(ngptc,levs,nblck,lats_node_r), stat = ierr)
701 ! endif
702 
703 ! idea add by hmhj - commented by moorthi since this is unused
704 ! ALLOCATE (gis_phy%HTRSWB(NGPTC,LEVS,NBDSW,NBLCK,LATS_NODE_R),stat=ierr)
705 ! ALLOCATE (gis_phy%HTRLWB(NGPTC,LEVS,NBDLW,NBLCK,LATS_NODE_R),stat=ierr)
706 
707 !
708  ALLOCATE (gis_phy%JINDX1(lats_node_r), stat = ierr)
709  ALLOCATE (gis_phy%JINDX2(lats_node_r), stat = ierr)
710  ALLOCATE (gis_phy%DDY(lats_node_r), stat = ierr)
711  if (h2o_phys) then
712  ALLOCATE (gis_phy%JINDX1_h(lats_node_r),gis_phy%JINDX2_h(lats_node_r))
713  ALLOCATE (gis_phy%DDY_h(lats_node_r))
714  else
715  ALLOCATE (gis_phy%JINDX1_h(1),gis_phy%JINDX2_h(1),gis_phy%DDY_h(1))
716  endif
717 !
718  allocate (gis_phy%phy_f3d(ngptc,levs,ntot3d,nblck,lats_node_r), stat = ierr)
719  allocate (gis_phy%phy_f2d(lonr,lats_node_r,ntot2d), stat = ierr)
720  if (cscnv) then
721  gis_phy%num_ctp = nctp
722  else
723  gis_phy%num_ctp = 1
724  endif
725  allocate (gis_phy%phy_fctd(lonr,lats_node_r,gis_phy%num_ctp), stat = ierr)
726 !
727  allocate (gis_phy%fhour_idate(1,5), stat = ierr )
728 !
729 ! write(0,*) ' check after lots allocates,size(fhour_idate)= ' , &
730 ! size(gis_phy%fhour_idate,1),size(gis_phy%fhour_idate,2),ierr
731 
732  if (ldiag3d) then
733 !* change lats_node_r to lats_node_r_max for consistency
734 !* call d3d_init(ngptc,nblck,lonr,lats_node_r,levs,pl_coeff)
735  call d3d_init(ngptc,nblck,lonr,lats_node_r_max,levs,pl_coeff)
736  endif
737 
738 !* allocate g3d_fld and g2d_fld
739  if (lgocart) then
740  call g3d_aldata (lonr, lats_node_r_max, levs, &
741  gis_phy%g3d_fld, ierr)
742 ! call g2d_aldata (lonr, lats_node_r_max, gis_phy%gfs_phy_tracer, &
743  call g2d_aldata (lonr, lats_node_r_max, gfs_phy_tracer, &
744  gis_phy%g2d_fld, ierr)
745 
746  ngrids_aer = 0
747  if ( gis_phy%g2d_fld%du%nfld > 0 ) &
748  ngrids_aer = ngrids_aer+gis_phy%g2d_fld%du%nfld
749 
750  if ( gis_phy%g2d_fld%su%nfld > 0 ) &
751  ngrids_aer = ngrids_aer+gis_phy%g2d_fld%su%nfld
752 
753  if ( gis_phy%g2d_fld%oc%nfld > 0 ) &
754  ngrids_aer = ngrids_aer+gis_phy%g2d_fld%oc%nfld
755 
756  if ( gis_phy%g2d_fld%bc%nfld > 0 ) &
757  ngrids_aer = ngrids_aer+gis_phy%g2d_fld%bc%nfld
758 
759  if ( gis_phy%g2d_fld%ss%nfld > 0 ) &
760  ngrids_aer = ngrids_aer+gis_phy%g2d_fld%ss%nfld
761 
762  if ( gis_phy%g2d_fld%met%nfld > 0 ) &
763  ngrids_aer = ngrids_aer+gis_phy%g2d_fld%met%nfld
764 
765 ! print *, 'INIT_g2d_fld ngrids_aer = ',ngrids_aer
766  endif
767 
768  if (ntot3d > 0) gis_phy%phy_f3d = 0.0
769  if (ntot2d > 0) gis_phy%phy_f2d = 0.0
770  if (cscnv) gis_phy%phy_fctd = 0.0
771 !jw
772 !jw allocate(buff_mult_piecea2d(lonr,lats_node_r_max,1:ngrids_sfcc2d+ngrids_nst+1))
773  allocate(buff_mult_piecea2d(lonr,lats_node_r_max,ngrids_sfcc2d+1))
774  allocate(buff_mult_piecea3d(lonr,lats_node_r_max,ngrids_sfcc3d+1))
775  allocate(buff_mult_piecef(lonr,lats_node_r_max,ngrids_flx+1))
776  allocate(buff_mult_pieceg(lonr,lats_node_r_max,ngrids_aer+1))
777  if (nstf_name(1) > 0) then
778  allocate(buff_mult_piecenst(lonr,lats_node_r_max,ngrids_nst+1))
779  endif
780 
781 ! write(0,*)' lonr=',lonr,' lats_node_r_max=',lats_node_r_max, &
782 ! 'ngrids_sfcc2d=',ngrids_sfcc2d,' ngrids_nst=',ngrids_nst, &
783 ! 'ngrids_flx=',ngrids_flx
784 
785  buff_mult_piecea2d(1:lonr,1:lats_node_r_max,1:ngrids_sfcc2d+1) = 0.
786  buff_mult_piecea3d(1:lonr,1:lats_node_r_max,1:ngrids_sfcc3d+1) = 0.
787  buff_mult_piecef(1:lonr,1:lats_node_r_max,1:ngrids_flx+1) = 0.
788  buff_mult_pieceg(1:lonr,1:lats_node_r_max,1:ngrids_aer+1) = 0.
789  if (nstf_name(1) > 0) then
790  buff_mult_piecenst(1:lonr,1:lats_node_r_max,1:ngrids_nst+1) = 0.
791  endif
792 !!
793 !!
794 ! write(0,*)' gis_phy%lonsperlar2b=',gis_phy%lonsperlar
795 ! write(0,*)' before fix_fields'
796 
797  call fix_fields(gis_phy%LONSPERLAR, gis_phy%GLOBAL_LATS_R, &
798  gis_phy%XLON, gis_phy%XLAT, gis_phy%sfc_fld, &
799  gis_phy%nst_fld, gis_phy%HPRIME, gis_phy%JINDX1, &
800  gis_phy%JINDX2, gis_phy%DDY, gis_phy%OZPLIN, &
801  gis_phy%JINDX1_h, gis_phy%JINDX2_h, gis_phy%DDY_h, &
802  gis_phy%h2oplin, &
803  gis_phy%nam_gfs_phy%sfc_ini, &
804  gis_phy%nam_gfs_phy%grd_ini, &
805  gis_phy%nam_gfs_phy%nst_ini, &
806  nblck, gis_phy%phy_f3d, gis_phy%phy_f2d )
807 
808 ! print *,' GISXLAT=',gis_phy%XLAT(1,:)
809 ! write(0,*)' after fix_fields'
810 !!
811 ! coord def (lats_node_r, ipt_lats_node_r, and lats_nodes_a_fix)
812  gis_phy%lats_node_r = lats_node_r
813  gis_phy%ipt_lats_node_r = ipt_lats_node_r
814 
815 ! call mpi_quit(3333)
816 !!
817 !! debug print (Sarah Lu)
818 ! if(me==0) then
819 ! do j=1,latr
820 ! print *, 'PHY: lonsperlar=',j,gis_phy%lonsperlar(j)
821 ! enddo
822 ! print *, 'PHY: lats_node_r_max=',gis_phy%lats_node_r_max
823 ! print *, 'PHY: lats_nodes_r=',gis_phy%lats_nodes_r(:)
824 ! print *, 'PHY: global_lats_r=',gis_phy%global_lats_r(:)
825 ! endif
826 ! print *, 'PHY: lats_node_r=',me,gis_phy%lats_node_r
827 ! n = 0
828 ! do j = 1, gis_phy%lats_node_r
829 ! ilat = gis_phy%global_lats_r(gis_phy%ipt_lats_node_r-1+j)
830 ! l = gis_phy%lonsperlar(ilat)
831 ! n = n + l
832 ! print *, 'PHY:, xlat=',me,n,gis_phy%ipt_lats_node_r-1+j,&
833 ! j, ilat, l, 57.29578*gis_phy%xlat(1,j)
834 ! enddo
835 !!
836 !!
837 
838 ! --- set up sigma levels before radiation initialization
839 
840  allocate (si_loc(levr+1))
841  if ( hybrid .and. (.not.gen_coord_hybrid) ) then
842 
843 ! --- following sela: si(k)=(ak5(k)+bk5(k)*Typical_pgr)/Typical_pgr
844 ! ak(k) and bk(k) go from top to bottom, adjust si_loc direction
845 ! according model direction flag iflip.
846 
847 ! if (iflip == 1) then ! vertical from sfc to top
848 !*********************************************************************
849 !!!! COMMENTED WHILE TESTING OTHER PARTS OF CODE !!!!!!!!!!!!!!!!!!!!!!
850 ! si_loc(levr+1) = ak5(1)/typical_pgr+bk5(1)
851  si_loc(levr+1) = 0.0
852  if(nemsio_in) then
853  do k = 1, levr
854  si_loc(levr+1-k) = ak5(levp1-levr+k)/typical_pgr &
855  & + bk5(levp1-levr+k)
856  enddo
857  else
858  do k = 1, levr
859  si_loc(k) = float(levr+1-k) / float(levr)
860  enddo
861  endif
862  if (me == 0) write(0,*)' si_loc=',si_loc(1:levr+1)
863 !*********************************************************************
864 ! else ! vertical from top to sfc
865 ! si_loc(1) = ak5(1)/typical_pgr+bk5(1)
866 ! do k = 1, levr
867 ! si_loc(k+1) = ak5(levp1-levr+k)/typical_pgr
868 ! &
869 ! & + bk5(levp1-levr+k)
870 ! enddo
871 ! endif
872  else
873 ! --- using the model's native sigama coordinate, si
874 ! si(k) goes from bottom to top, adjust si_loc direction
875 ! according model direction flag iflip.
876 
877 ! if (iflip == 1) then ! vertical from sfc to top
878  si = 0.
879  do k = 1, levr
880  si_loc(k) = si(k)
881  enddo
882  si_loc(levr+1) = si(levp1)
883 ! else ! vertical from top to sfc
884 ! do k = 1, levr
885 ! si_loc(k+1) = si(levr-k+1)
886 ! enddo
887 ! si_loc(1) = si(levp1)
888 ! endif
889  endif ! end_if_hybrid
890 
891 ! This is called in nuopc_phys_init, don't run twice if using the wrapper
892 
893  if ( .not. use_nuopc ) then
894  call rad_initialize &
895 ! --- inputs:
896  & ( si_loc,levr,ictm,isol,ico2,iaer,ialb,iems,ntcw, &
897  & num_p3d,npdf3d,ntoz,iovr_sw,iovr_lw,isubc_sw,isubc_lw, &
898  & crick_proof,ccnorm,norad_precip,idate,iflip,me )
899 !
900  if (ncld == 2) then ! initialize Morrison-Gettleman microphysics
901 ! call ini_micro(350.0e-6,2.0) !Anning Cheng 09/15/2015
902  call ini_micro(mg_dcs,mg_qcvar,mg_ts_auto_ice) !Anning Cheng 09/15/2015 Moorthi 07/14/2016
903  call aer_cloud_init()
904  endif
905  endif
906 
907 ! --- outputs: ( none )
908 !
909 ! zero fluxes and diagnostics
910 !
911  gis_phy%zhour = gis_phy%phour
912 
913  if (me == 0) &
914  write(0,*)' in physics initialize phour=',gis_phy%phour, &
915  ' fhour=',fhour,' zhour=',gis_phy%zhour
916 
917  gis_phy%FLUXR = 0.
918 !
919  call flx_init(gis_phy%flx_fld, ierr)
920 
921 ! Add (Xingren Wu)
922  if (a2oi_out .or. cplflx) then
923  call aoivar_init(gis_phy%aoi_fld, ierr)
924  endif
925 
926  if (ldiag3d) then
927  call d3d_zero
928  endif
929 
930  if (use_nuopc) then
931 
932  call ozoneini(gis_phy%mdl_parm, gis_phy%JINDX1,gis_phy%JINDX2,gis_phy%OZPLIN,gis_phy%DDY)
933  call h2oini(gis_phy%mdl_parm, gis_phy%JINDX1_h,gis_phy%JINDX2_h,&
934  gis_phy%H2OPLIN,gis_phy%DDY_h, h2o_pres(1:levh2o))
935 
936  associate(mdl_parm => gis_phy%mdl_parm)
937 
938  call nuopc_phys_init ( &
939  mdl_parm, ntcw, ncld, ntoz, ntrac, levs, me, lsoil, ntiw,ntlnc,ntinc, &
940  lsm, nmtvr, nrcm, levozp, levh2o, lonr, latr, jcap, num_p3d, num_p2d, &
941  npdf3d, ncnvcld3d, pl_coeff, ncw, crtrh, cdmbgwd, ccwf, dlqf,ctei_rm, &
942  cgwf, prslrd0, ral_ts, ras, pre_rad, ldiag3d, lgocart,cplflx,flipv, &
943  old_monin,cnvgwd, shal_cnv, imfshalcnv,imfdeepcnv, cal_pre, mom4ice, &
944  mstrat,trans_trac,nstf_name,moist_adj,thermodyn_id,sfcpress_id, &
945  gen_coord_hybrid, levr, lsidea, pdfcld, shcnvcw, redrag, &
946  hybedmf, dspheat, dxmax, dxmin, dxinv, h2o_phys, h2o_coeff,&
947  cscnv, gis_phy%num_ctp, ntke, do_shoc, shocaftcnv, ntot3d, ntot2d, &
948  si_loc, ictm, isol, ico2, iaer, ialb, iems, isot, ivegsrc,&
949  iovr_sw,iovr_lw,isubc_sw,isubc_lw, shoc_cld, &
950  crick_proof,ccnorm,norad_precip,idate,iflip,nlunit, gis_phy%lats_node_r)
951 
952  call mdl_parm%print("In gfs_physics_initialize")
953  end associate
954  end if
955 !
956 !
957 ! initialize start_step (Sarah Lu)
958 
959  gis_phy% start_step = .true.
960 
961  rc = 0
962 !
963  if (allocated(si_loc)) deallocate (si_loc)
964  phys_ini_time = phys_ini_time + (timef() - btime)
965  write(0,*)' phys_ini_time=',phys_ini_time*1.0e-3,' me=',me
966 !
967 ! write(0,*)' gis_phy%lonsperlar2=',gis_phy%lonsperlar
968 ! write(0,*)' returning from gfs_physics_initialize'
969 !
970  end subroutine gfs_physics_initialize
971 !
972 ! =========================================================================
973 !
974  end module gfs_physics_initialize_mod
subroutine, public nuopc_phys_init(mdl, ntcw, ncld, ntoz, NTRAC, levs, me, lsoil, ntiw, ntlnc, ntinc, lsm, nmtvr, nrcm, levozp, levh2o, lonr, latr, jcap, num_p3d, num_p2d, npdf3d, ncnvcld3d, pl_coeff, ncw, crtrh, cdmbgwd, ccwf, dlqf, ctei_rm, cgwf, prslrd0, ral_ts, ras, pre_rad, ldiag3d, lgocart, lssav_cpl, flipv, old_monin, cnvgwd, shal_cnv, imfshalcnv, imfdeepcnv, cal_pre, mom4ice, mstrat, trans_trac, nstf_name, moist_adj, thermodyn_id, sfcpress_id, gen_coord_hybrid, levr, lsidea, pdfcld, shcnvcw, redrag, hybedmf, dspheat, dxmaxin, dxminin, dxinvin, h2o_phys, h2o_coeff,
— initialization module of the gridded component of gfs physics.
subroutine rad_initialize
Definition: rad_initialize.f:4
subroutine, public phys_init_savein(levr, ntcw, ncld, ntoz, NTRAC, levs, me, lsoil, lsm, nmtvr, nrcm, levozp, lonr, latr, jcap, num_p3d, num_p2d, npdf3d, ncnvcld3d, pl_coeff, ncw, nstf_name, thermodyn_id, sfcpress_id, crtrh, cdmbgwd, ccwf, dlqf, ctei_rm, cgwf, prslrd0, ral_ts, ras, pre_rad, ldiag3d, lgocart, lssav_cpl, flipv, old_monin, cnvgwd, shal_cnv, imfshalcnv, imfdeepcnv, cal_pre, mom4ice, mstrat, trans_trac, moist_adj, gen_coord_hybrid, lsidea, pdfcld, shcnvcw, redrag, hybedmf, dspheat, dxmax, dxmin, dxinv,
subroutine, public phys_init_readin(levr, ntcw, ncld, ntoz, NTRAC, levs, me, lsoil, lsm, nmtvr, nrcm, levozp, lonr, latr, jcap, num_p3d, num_p2d, npdf3d, ncnvcld3d, pl_coeff, ncw, nstf_name, thermodyn_id, sfcpress_id, crtrh, cdmbgwd, ccwf, dlqf, ctei_rm, cgwf, prslrd0, ral_ts, ras, pre_rad, ldiag3d, lgocart, lssav_cpl, flipv, old_monin, cnvgwd, shal_cnv, imfshalcnv, imfdeepcnv, cal_pre, mom4ice, mstrat, trans_trac, moist_adj, gen_coord_hybrid, lsidea, pdfcld, shcnvcw, redrag, hybedmf, dspheat, dxmaxin, dxminin, dxinvin,
Reads inputs that are used for nuopc_phys_init from init_savein.dat.
subroutine, public h2oini(this, jindx1_h, jindx2_h, h2oplin, ddy_h, h2o_pres)
subroutine, public ozoneini(this, jindx1, jindx2, ozplin, ddy)
Writes inputs that are used for nuopc_phys_init to init_savein.dat.
DDT for non-changing model parameters - set once in initialize.
subroutine gfs_physics_initialize(gis_phy, rc)
the interface between the dynamic core and the physics packages
subroutine set_soilveg(me, isot, ivet, nlunit)
Definition: set_soilveg.f:2