137 use constants_mod
, only: kappa, pi=>pi_8, omega, rdgas, grav, rvgas, cp_air, radius
146 use mpp_domains_mod
, only: mpp_update_domains, domain2d, dgrid_ne
147 use mpp_mod
, only: mpp_chksum, stdout, mpp_error, fatal, note
148 use mpp_mod
, only: get_unit, mpp_sum, mpp_broadcast
149 use mpp_mod
, only: mpp_get_current_pelist, mpp_npes, mpp_set_current_pelist
151 use fv_mp_mod, only: is_master, mp_reduce_min, mp_reduce_max, corners_ydir => ydir, fill_corners, tile_fine, global_nest_domain
153 use tracer_manager_mod
, only: get_tracer_names
154 use field_manager_mod
, only: model_atmos
159 use tracer_manager_mod
, only: get_tracer_index
160 use field_manager_mod
, only: model_atmos
162 use mpp_domains_mod
, only: mpp_get_compute_domain, mpp_get_data_domain, mpp_get_global_domain
163 use mpp_mod
, only: mpp_send, mpp_recv, mpp_sync_self, mpp_set_current_pelist, mpp_get_current_pelist, mpp_npes, mpp_pe, mpp_sync
164 use mpp_domains_mod
, only: center, corner, north, east, mpp_get_c2f_index, west, south
165 use mpp_domains_mod
, only: mpp_global_field
166 use fms_mod
, only: file_exist
195 subroutine fv_restart(fv_domain, Atm, dt_atmos, seconds, days, cold_start, grid_type, this_grid)
196 type(domain2d),
intent(inout) :: fv_domain
198 real,
intent(in) :: dt_atmos
199 integer,
intent(out) :: seconds
200 integer,
intent(out) :: days
201 logical,
intent(inout) :: cold_start
202 integer,
intent(in) :: grid_type, this_grid
204 integer :: i, j, k, n, ntileMe, nt, iq
205 integer :: isc, iec, jsc, jec, ncnst, ntprog, ntdiag
206 integer :: isd, ied, jsd, jed, npz
207 integer isd_p, ied_p, jsd_p, jed_p, isc_p, iec_p, jsc_p, jec_p, isg, ieg, jsg,jeg, npx_p, npy_p
208 real,
allocatable :: g_dat(:,:,:)
211 real,
allocatable :: dz1(:)
212 real rgrav, f00, ztop, pertn, ph
214 character(len=128):: tname, errstring, fname, tracer_name
215 character(len=120):: fname_ne, fname_sw
216 character(len=3) :: gn
218 integer :: npts, sphum
219 integer,
allocatable :: pelist(:), smoothed_topo(:)
223 integer :: i_butterfly, j_butterfly
224 logical :: do_read_restart = .false.
225 logical :: do_read_restart_bc = .false.
226 integer,
allocatable :: ideal_test_case(:), new_nest_topo(:)
232 ntileme =
size(atm(:))
233 allocate(smoothed_topo(ntileme))
235 allocate(ideal_test_case(ntileme))
236 ideal_test_case(:) = 0
237 allocate(new_nest_topo(ntileme))
251 if( is_master() )
write(*,*)
'in fv_restart ncnst=', ncnst
253 ntprog =
size(atm(n)%q,4)
254 ntdiag =
size(atm(n)%qdiag,4)
261 if (atm(n)%neststruct%nested)
then 262 write(fname,
'(A, I2.2, A)')
'INPUT/fv_core.res.nest', atm(n)%grid_number,
'.nc' 263 write(fname_ne,
'(A, I2.2, A)')
'INPUT/fv_BC_ne.res.nest', atm(n)%grid_number,
'.nc' 264 write(fname_sw,
'(A, I2.2, A)')
'INPUT/fv_BC_sw.res.nest', atm(n)%grid_number,
'.nc' 265 if (is_master()) print*,
'Searching for nested grid BC files ', trim(fname_ne),
' ', trim(fname_sw)
266 do_read_restart = file_exist(fname, atm(n)%domain)
267 do_read_restart_bc = file_exist(fname_ne, atm(n)%domain) .and. file_exist(fname_sw, atm(n)%domain)
268 if (is_master())
then 269 print*,
'FV_RESTART: ', n, do_read_restart, do_read_restart_bc
270 if (.not. do_read_restart_bc)
write(*,*)
'BC files not found, re-generating nested grid boundary conditions' 272 atm(n)%neststruct%first_step = .not. do_read_restart_bc
274 fname=
'INPUT/fv_core.res.nc' 275 do_read_restart = file_exist(
'INPUT/fv_core.res.nc') .or. file_exist(
'INPUT/fv_core.res.tile1.nc')
276 if (is_master()) print*,
'FV_RESTART: ', n, do_read_restart, do_read_restart_bc
287 if (atm(n)%neststruct%nested)
then 288 if (.not.
allocated(pelist))
then 289 allocate(pelist(0:mpp_npes()-1))
290 call mpp_get_current_pelist(pelist)
292 call mpp_set_current_pelist()
293 call mpp_broadcast(atm(n)%flagstruct%external_ic,atm(n)%pelist(1))
295 call mpp_set_current_pelist(pelist)
296 if ( ( smoothed_topo(atm(n)%parent_grid%grid_number) > 0 .or. &
297 .not. do_read_restart_bc .or. &
298 atm(n)%flagstruct%external_ic ) )
then 300 if (n==this_grid)
then 304 call nested_grid_bc(atm(n)%ps, atm(n)%parent_grid%ps, global_nest_domain, &
305 atm(n)%neststruct%ind_h, atm(n)%neststruct%wt_h, 0, 0, &
306 atm(n)%npx, atm(n)%npy, atm(n)%bd, 1, atm(n)%npx-1, 1, atm(n)%npy-1)
308 elseif (this_grid==atm(n)%parent_grid%grid_number)
then 313 call nested_grid_bc(atm(n)%parent_grid%ps, global_nest_domain, 0, 0, n-1)
330 if (n==this_grid)
then 333 if (atm(n)%flagstruct%external_ic)
then 334 if( is_master() )
write(*,*)
'Calling get_external_ic' 335 call get_external_ic(atm(n), atm(n)%domain, .not. do_read_restart, dt_atmos)
336 if( is_master() )
write(*,*)
'IC generated from the specified external source' 339 elseif (do_read_restart)
then 341 if ( atm(n)%flagstruct%npz_rst /= 0 .and. atm(n)%flagstruct%npz_rst /= atm(n)%npz )
then 343 if( is_master() )
then 345 write(*,*)
'***** Important Note from FV core ********************' 346 write(*,*)
'Remapping dynamic IC from', atm(n)%flagstruct%npz_rst,
'levels to ', atm(n)%npz,
'levels' 347 write(*,*)
'***** End Note from FV core **************************' 351 if( is_master() )
write(*,*)
'Done remapping dynamical IC' 353 if( is_master() )
write(*,*)
'Warm starting, calling fv_io_restart' 356 if (atm(n)%flagstruct%read_increment)
then 358 i = (atm(n)%bd%isc + atm(n)%bd%iec)/2
359 j = (atm(n)%bd%jsc + atm(n)%bd%jec)/2
361 if( is_master() )
write(*,*)
'Calling read_da_inc',atm(n)%pt(i,j,k)
362 call read_da_inc(atm(n), atm(n)%domain, atm(n)%bd, atm(n)%npz, atm(n)%ncnst, &
363 atm(n)%u, atm(n)%v, atm(n)%q, atm(n)%delp, atm(n)%pt, atm(n)%delz, isd, jsd, ied, jed, &
365 if( is_master() )
write(*,*)
'Back from read_da_inc',atm(n)%pt(i,j,k)
370 seconds = 0; days = 0
372 if (atm(n)%neststruct%nested)
then 373 if ( atm(n)%flagstruct%npz_rst /= 0 .and. atm(n)%flagstruct%npz_rst /= npz )
then 374 call mpp_error(fatal,
"Remap-restart not implemented for nests.")
377 call mpp_update_domains(atm(n)%u, atm(n)%v, atm(n)%domain, gridtype=dgrid_ne, complete=.true.)
380 if ( atm(n)%flagstruct%mountain )
then 382 if ( atm(n)%flagstruct%n_zs_filter > 0 )
then 383 if ( atm(n)%flagstruct%nord_zs_filter == 2 )
then 386 atm(n)%gridstruct%area_64, atm(n)%gridstruct%dx, atm(n)%gridstruct%dy, &
387 atm(n)%gridstruct%dxc, atm(n)%gridstruct%dyc, atm(n)%gridstruct%sin_sg, &
388 atm(n)%flagstruct%n_zs_filter,
cnst_0p20*atm(n)%gridstruct%da_min, &
389 .false., oro_g, atm(n)%gridstruct%bounded_domain, atm(n)%domain, atm(n)%bd)
390 if ( is_master() )
write(*,*)
'Warning !!! del-2 terrain filter has been applied ', &
391 atm(n)%flagstruct%n_zs_filter,
' times' 392 else if( atm(n)%flagstruct%nord_zs_filter == 4 )
then 393 call del4_cubed_sphere(atm(n)%npx, atm(n)%npy, atm(n)%phis, atm(n)%gridstruct%area_64, &
394 atm(n)%gridstruct%dx, atm(n)%gridstruct%dy, &
395 atm(n)%gridstruct%dxc, atm(n)%gridstruct%dyc, atm(n)%gridstruct%sin_sg, &
396 atm(n)%flagstruct%n_zs_filter, .false., oro_g, atm(n)%gridstruct%bounded_domain, &
397 atm(n)%domain, atm(n)%bd)
398 if ( is_master() )
write(*,*)
'Warning !!! del-4 terrain filter has been applied ', &
399 atm(n)%flagstruct%n_zs_filter,
' times' 402 call mpp_update_domains( atm(n)%phis, atm(n)%domain, complete=.true. )
405 if( is_master() )
write(*,*)
'phis set to zero' 413 ideal_test_case(n) = 1
415 if ( atm(n)%flagstruct%make_hybrid_z )
then 418 hybrid = atm(n)%flagstruct%hybrid_z
420 if (grid_type < 4)
then 421 if ( .not. atm(n)%flagstruct%external_ic )
then 422 call init_case(atm(n)%u,atm(n)%v,atm(n)%w,atm(n)%pt,atm(n)%delp,atm(n)%q, &
423 atm(n)%phis, atm(n)%ps,atm(n)%pe, atm(n)%peln,atm(n)%pk,atm(n)%pkz, &
424 atm(n)%uc,atm(n)%vc, atm(n)%ua,atm(n)%va, &
425 atm(n)%ak, atm(n)%bk, atm(n)%gridstruct, atm(n)%flagstruct,&
426 atm(n)%npx, atm(n)%npy, npz, atm(n)%ng, &
427 ncnst, atm(n)%flagstruct%nwat, &
428 atm(n)%flagstruct%ndims, atm(n)%flagstruct%ntiles, &
429 atm(n)%flagstruct%dry_mass, &
430 atm(n)%flagstruct%mountain, &
431 atm(n)%flagstruct%moist_phys, atm(n)%flagstruct%hydrostatic, &
432 hybrid, atm(n)%delz, atm(n)%ze0, &
433 atm(n)%flagstruct%adiabatic, atm(n)%ks, atm(n)%neststruct%npx_global, &
434 atm(n)%ptop, atm(n)%domain, atm(n)%tile_of_mosaic, atm(n)%bd)
436 elseif (grid_type == 4)
then 438 atm(n)%delp,atm(n)%q,atm(n)%phis, atm(n)%ps,atm(n)%pe, &
439 atm(n)%peln,atm(n)%pk,atm(n)%pkz, &
440 atm(n)%uc,atm(n)%vc, atm(n)%ua,atm(n)%va, &
441 atm(n)%ak, atm(n)%bk, &
442 atm(n)%gridstruct, atm(n)%flagstruct, &
443 atm(n)%npx, atm(n)%npy, npz, atm(n)%ng, &
444 ncnst, atm(n)%flagstruct%nwat, &
445 atm(n)%flagstruct%ndims, atm(n)%flagstruct%ntiles, &
446 atm(n)%flagstruct%dry_mass, atm(n)%flagstruct%mountain, &
447 atm(n)%flagstruct%moist_phys, atm(n)%flagstruct%hydrostatic, &
448 hybrid, atm(n)%delz, atm(n)%ze0, atm(n)%ks, atm(n)%ptop, &
449 atm(n)%domain, atm(n)%tile_of_mosaic, atm(n)%bd)
450 if( is_master() )
write(*,*)
'Doubly Periodic IC generated' 451 elseif (grid_type == 5 .or. grid_type == 6)
then 452 call mpp_error(fatal,
"Idealized test cases for grid_type == 5,6 (global lat-lon) grid not supported")
457 if ( atm(n)%flagstruct%fv_land )
then 460 atm(n)%sgh(i,j) = sgh_g(i,j)
461 atm(n)%oro(i,j) = oro_g(i,j)
487 if (ntileme > 1)
then 488 if (.not.
allocated(pelist))
then 489 allocate(pelist(0:mpp_npes()-1))
490 call mpp_get_current_pelist(pelist)
493 call mpp_set_current_pelist()
495 call mpp_broadcast(atm(n)%ptop,atm(n)%pelist(1))
496 call mpp_broadcast(atm(n)%ak,atm(n)%npz+1,atm(n)%pelist(1))
497 call mpp_broadcast(atm(n)%bk,atm(n)%npz+1,atm(n)%pelist(1))
499 call mpp_broadcast(smoothed_topo(n),atm(n)%pelist(1))
502 call mpp_set_current_pelist(pelist)
505 if (atm(n)%neststruct%nested)
then 506 atm(n)%neststruct%do_remap_BC(ntileme) = .false.
508 if (atm(n)%npz /= atm(n)%parent_grid%npz)
then 509 atm(n)%neststruct%do_remap_BC(n) = .true.
512 if (atm(n)%ak(k) /= atm(n)%parent_grid%ak(k))
then 513 atm(n)%neststruct%do_remap_BC(n) = .true.
516 if (atm(n)%bk(k) /= atm(n)%parent_grid%bk(k))
then 517 atm(n)%neststruct%do_remap_BC(n) = .true.
523 atm(n)%parent_grid%neststruct%do_remap_BC(n) = atm(n)%neststruct%do_remap_BC(n)
524 if (is_master() .and. n==this_grid)
then 525 if (atm(n)%neststruct%do_remap_BC(n))
then 526 print*,
' Remapping BCs ENABLED on grid', n
528 print*,
' Remapping BCs DISABLED (not necessary) on grid', n
530 write(*,
'(A, I3, A, F8.2, A)')
' Nested grid ', n,
', ptop = ', atm(n)%ak(1),
' Pa' 531 write(*,
'(A, I3, A, F8.2, A)')
' Parent grid ', n,
', ptop = ', atm(n)%parent_grid%ak(1),
' Pa' 532 if (atm(n)%ak(1) < atm(n)%parent_Grid%ak(1))
then 533 print*,
' WARNING nested grid top above parent grid top. May have problems with remapping BCs.' 544 if (new_nest_topo(n) > 0 )
then 552 if (n/=this_grid) cycle
563 if( is_master() )
write(*,*)
'in fv_restart ncnst=', ncnst
565 ntprog =
size(atm(n)%q,4)
566 ntdiag =
size(atm(n)%qdiag,4)
569 if ( ideal_test_case(n) == 0 )
then 573 if ( .not.atm(n)%flagstruct%hybrid_z )
then 574 if(atm(n)%ptop/=atm(n)%ak(1))
call mpp_error(fatal,
'FV restart: ptop not equal Atm(n)%ak(1)')
576 atm(n)%ptop = atm(n)%ak(1); atm(n)%ks = 0
579 atm(n)%delp, atm(n)%delz, atm(n)%pt, atm(n)%ps, atm(n)%pe, atm(n)%peln, &
580 atm(n)%pk, atm(n)%pkz, kappa, atm(n)%q, atm(n)%ng, &
581 ncnst, atm(n)%gridstruct%area_64, atm(n)%flagstruct%dry_mass, &
582 atm(n)%flagstruct%adjust_dry_mass, atm(n)%flagstruct%mountain, &
583 atm(n)%flagstruct%moist_phys, atm(n)%flagstruct%hydrostatic, &
584 atm(n)%flagstruct%nwat, atm(n)%domain, atm(1)%flagstruct%adiabatic, atm(n)%flagstruct%make_nh)
586 if ( grid_type < 7 .and. grid_type /= 4 )
then 591 atm(n)%gridstruct%fc(i,j) = 2.*omega*( -cos(atm(n)%gridstruct%grid(i,j,1))*cos(atm(n)%gridstruct%grid(i,j,2))*sin(
alpha) + &
592 sin(atm(n)%gridstruct%grid(i,j,2))*cos(
alpha) )
597 atm(n)%gridstruct%f0(i,j) = 2.*omega*( -cos(atm(n)%gridstruct%agrid(i,j,1))*cos(atm(n)%gridstruct%agrid(i,j,2))*sin(
alpha) + &
598 sin(atm(n)%gridstruct%agrid(i,j,2))*cos(
alpha) )
602 f00 = 2.*omega*sin(atm(n)%flagstruct%deglat/180.*pi)
605 atm(n)%gridstruct%fc(i,j) = f00
610 atm(n)%gridstruct%f0(i,j) = f00
614 call mpp_update_domains( atm(n)%gridstruct%f0, atm(n)%domain )
615 if ( atm(n)%gridstruct%cubed_sphere .and. (.not. atm(n)%gridstruct%bounded_domain))
then 616 call fill_corners(atm(n)%gridstruct%f0, atm(n)%npx, atm(n)%npy, corners_ydir)
623 if ( atm(n)%flagstruct%hybrid_z )
then 624 if ( atm(n)%flagstruct%make_hybrid_z )
then 625 allocate ( dz1(npz) )
632 call set_hybrid_z(isc, iec, jsc, jec, atm(n)%ng, npz, ztop, dz1, rgrav, &
633 atm(n)%phis, atm(n)%ze0)
642 if (atm(n)%flagstruct%add_noise > 0.)
then 643 write(errstring,
'(A, E16.9)')
"Adding thermal noise of amplitude ", atm(n)%flagstruct%add_noise
644 call mpp_error(note, errstring)
651 call random_number(pertn)
652 atm(n)%pt(i,j,k) = atm(n)%pt(i,j,k) + pertn*atm(n)%flagstruct%add_noise
654 sumpertn = sumpertn + pertn*atm(n)%flagstruct%add_noise ** 2
658 call mpp_update_domains(atm(n)%pt, atm(n)%domain)
659 call mpp_sum(sumpertn)
661 write(errstring,
'(A, E16.9)')
"RMS added noise: ", sqrt(sumpertn/npts)
662 call mpp_error(note, errstring)
665 if (atm(n)%flagstruct%butterfly_effect)
then 666 if (n==1 .and. atm(n)%tile_of_mosaic == 1)
then 667 i_butterfly = atm(n)%npx / 2
668 j_butterfly = atm(n)%npy / 2
669 if (isc <= i_butterfly .and. i_butterfly <= iec)
then 670 if (jsc <= j_butterfly .and. j_butterfly <= jec)
then 672 write(*,
'(A, I0, A, I0)')
"Adding butterfly effect at (i,j) ", i_butterfly,
", ", j_butterfly
673 write(*,
'(A, E24.17)')
"pt (before) :", atm(n)%pt(i_butterfly,j_butterfly,atm(n)%npz)
675 atm(n)%pt(i_butterfly,j_butterfly,atm(n)%npz) = nearest(atm(n)%pt(i_butterfly,j_butterfly,atm(n)%npz), -1.0)
677 write(*,
'(A, E24.17)')
"pt (after) :", atm(n)%pt(i_butterfly,j_butterfly,atm(n)%npz)
683 if (atm(n)%flagstruct%fv_sg_adj > 0 .and. atm(n)%flagstruct%sg_cutoff > 0)
then 686 ph = atm(n)%ak(k+1) + atm(n)%bk(k+1)*atm(n)%flagstruct%p_ref
687 if (ph > atm(n)%flagstruct%sg_cutoff)
exit 689 atm(n)%flagstruct%n_sponge = min(k,npz)
690 write(errstring,
'(A, I3, A)')
' Override n_sponge: applying 2dz filter to ', k ,
' levels' 691 call mpp_error(note, errstring)
694 if (atm(n)%grid_number > 1)
then 695 write(gn,
'(A2, I1)')
" g", atm(n)%grid_number
703 write(unit,*)
'fv_restart u ', trim(gn),
' = ', mpp_chksum(atm(n)%u(isc:iec,jsc:jec,:))
704 write(unit,*)
'fv_restart v ', trim(gn),
' = ', mpp_chksum(atm(n)%v(isc:iec,jsc:jec,:))
705 if ( .not.atm(n)%flagstruct%hydrostatic ) &
706 write(unit,*)
'fv_restart w ', trim(gn),
' = ', mpp_chksum(atm(n)%w(isc:iec,jsc:jec,:))
707 write(unit,*)
'fv_restart delp', trim(gn),
' = ', mpp_chksum(atm(n)%delp(isc:iec,jsc:jec,:))
708 write(unit,*)
'fv_restart phis', trim(gn),
' = ', mpp_chksum(atm(n)%phis(isc:iec,jsc:jec))
711 call prt_maxmin(
'H ', atm(n)%delp, isc, iec, jsc, jec, atm(n)%ng, 1, rgrav)
713 write(unit,*)
'fv_restart pt ', trim(gn),
' = ', mpp_chksum(atm(n)%pt(isc:iec,jsc:jec,:))
715 write(unit,*)
'fv_restart q(prog) nq ', trim(gn),
' =',ntprog, mpp_chksum(atm(n)%q(isc:iec,jsc:jec,:,:))
717 write(unit,*)
'fv_restart q(diag) nq ', trim(gn),
' =',ntdiag, mpp_chksum(atm(n)%qdiag(isc:iec,jsc:jec,:,:))
718 do iq=1,min(17, ntprog)
719 call get_tracer_names(model_atmos, iq, tracer_name)
720 write(unit,*)
'fv_restart '//trim(tracer_name)//
' = ', mpp_chksum(atm(n)%q(isc:iec,jsc:jec,:,iq))
726 call pmaxmn_g(
'ZS', atm(n)%phis, isc, iec, jsc, jec, 1, rgrav, atm(n)%gridstruct%area_64, atm(n)%domain)
727 call pmaxmn_g(
'PS', atm(n)%ps, isc, iec, jsc, jec, 1, 0.01, atm(n)%gridstruct%area_64, atm(n)%domain)
728 call pmaxmn_g(
'T ', atm(n)%pt, isc, iec, jsc, jec, npz, 1., atm(n)%gridstruct%area_64, atm(n)%domain)
732 call get_tracer_names ( model_atmos, i, tname )
733 call pmaxmn_g(trim(tname), atm(n)%q(isd:ied,jsd:jed,1:npz,i:i), isc, iec, jsc, jec, npz, &
734 1., atm(n)%gridstruct%area_64, atm(n)%domain)
737 call prt_maxmin(
'U ', atm(n)%u(isc:iec,jsc:jec,1:npz), isc, iec, jsc, jec, 0, npz, 1.)
738 call prt_maxmin(
'V ', atm(n)%v(isc:iec,jsc:jec,1:npz), isc, iec, jsc, jec, 0, npz, 1.)
740 if ( (.not.atm(n)%flagstruct%hydrostatic) .and. atm(n)%flagstruct%make_nh )
then 741 call mpp_error(note,
" Initializing w to 0")
743 sphum = get_tracer_index(model_atmos,
'sphum')
744 if ( .not.atm(n)%flagstruct%hybrid_z )
then 745 if (atm(n)%flagstruct%adiabatic .or. sphum < 0)
then 748 zvir = rvgas/rdgas - 1.
753 atm(n)%delz(i,j,k) = (rdgas*rgrav)*atm(n)%pt(i,j,k)*(1.+zvir*atm(n)%q(i,j,k,sphum))*(atm(n)%peln(i,k,j)-atm(n)%peln(i,k+1,j))
760 if ( .not.atm(n)%flagstruct%hydrostatic ) &
761 call pmaxmn_g(
'W ', atm(n)%w, isc, iec, jsc, jec, npz, 1., atm(n)%gridstruct%area_64, atm(n)%domain)
763 if (is_master())
write(unit,*)
768 if ( .not. atm(n)%flagstruct%srf_init )
then 771 atm(n)%npx, atm(n)%npy, npz, 1, &
772 atm(n)%gridstruct%grid_type, atm(n)%domain, &
773 atm(n)%gridstruct%bounded_domain, atm(n)%flagstruct%c2l_ord, atm(n)%bd)
776 atm(n)%u_srf(i,j) = atm(n)%ua(i,j,npz)
777 atm(n)%v_srf(i,j) = atm(n)%va(i,j,npz)
780 atm(n)%flagstruct%srf_init = .true.
792 logical,
intent(IN),
OPTIONAL :: proc_in
793 integer :: isd, ied, jsd, jed
795 if (.not. atm%neststruct%nested)
return 797 call mpp_get_data_domain( atm%parent_grid%domain, &
801 if (is_master()) print*,
' FILLING NESTED GRID HALO WITH INTERPOLATED TERRAIN' 802 call nested_grid_bc(atm%phis, atm%parent_grid%phis, global_nest_domain, &
803 atm%neststruct%ind_h, atm%neststruct%wt_h, 0, 0, &
804 atm%npx, atm%npy, atm%bd, isd, ied, jsd, jed, proc_in=proc_in, nest_level=atm%grid_number-1)
813 logical,
intent(IN),
OPTIONAL :: proc_in
814 real,
allocatable :: g_dat(:,:,:)
815 integer :: p, sending_proc
816 integer :: isd_p, ied_p, jsd_p, jed_p
817 integer :: isg, ieg, jsg,jeg
822 if (
present(proc_in))
then 830 call mpp_get_global_domain( atm%parent_grid%domain, &
832 call mpp_get_data_domain( atm%parent_grid%domain, &
833 isd_p, ied_p, jsd_p, jed_p )
835 allocate(g_dat( isg:ieg, jsg:jeg, 1) )
841 if (is_master() .and. .not. atm%flagstruct%external_ic ) print*,
' FILLING NESTED GRID INTERIOR WITH INTERPOLATED TERRAIN' 843 sending_proc = (atm%parent_grid%pelist(1)) + &
844 (atm%neststruct%parent_tile-tile_fine(atm%parent_grid%grid_number)+atm%parent_grid%flagstruct%ntiles-1)*atm%parent_grid%npes_per_tile
845 if (atm%neststruct%parent_tile == atm%parent_grid%global_tile)
then 847 call mpp_global_field( &
848 atm%parent_grid%domain, &
849 atm%parent_grid%phis(isd_p:ied_p,jsd_p:jed_p), g_dat(isg:,jsg:,1), position=center)
850 if (mpp_pe() == sending_proc)
then 851 do p=1,
size(atm%pelist)
852 call mpp_send(g_dat,
size(g_dat),atm%pelist(p))
857 if (any(atm%pelist == mpp_pe()))
then 858 call mpp_recv(g_dat,
size(g_dat), sending_proc)
863 atm%neststruct%ind_h, atm%neststruct%wt_h, &
864 0, 0, isg, ieg, jsg, jeg, atm%bd)
879 logical,
intent(IN),
OPTIONAL :: proc_in
880 real,
allocatable :: g_dat(:,:,:), pt_coarse(:,:,:)
881 integer :: i,j,k,nq, sphum, ncnst, istart, iend, npz
882 integer :: isc, iec, jsc, jec, isd, ied, jsd, jed
883 integer :: isd_p, ied_p, jsd_p, jed_p, isc_p, iec_p, jsc_p, jec_p
884 integer :: isg, ieg, jsg,jeg, npx_p, npy_p
885 integer :: isg_n, ieg_n, jsg_n, jeg_n, npx_n, npy_n
886 real zvir, gh0, p1(2), p2(2), r, r0
888 integer :: p, sending_proc, gid, n
891 call mpp_error(fatal,
" FILL_NESTED_GRID_DATA not yet updated for remap BCs")
893 if (
present(proc_in))
then 904 isc = atm(1)%bd%isc; iec = atm(1)%bd%iec; jsc = atm(1)%bd%jsc; jec = atm(1)%bd%jec
910 sending_proc = atm(1)%parent_grid%pelist(1) + (atm(1)%neststruct%parent_tile-1)*atm(1)%parent_grid%npes_per_tile
912 call mpp_get_data_domain( atm(1)%parent_grid%domain, &
913 isd_p, ied_p, jsd_p, jed_p )
914 call mpp_get_compute_domain( atm(1)%parent_grid%domain, &
915 isc_p, iec_p, jsc_p, jec_p )
916 call mpp_get_global_domain( atm(1)%parent_grid%domain, &
917 isg, ieg, jsg, jeg, xsize=npx_p, ysize=npy_p)
921 call mpp_error(note,
"FILLING NESTED GRID DATA")
925 call mpp_error(note,
"SENDING TO FILL NESTED GRID DATA")
931 allocate(g_dat( isg:ieg, jsg:jeg, npz) )
937 if (atm(1)%neststruct%parent_proc .and. atm(1)%neststruct%parent_tile == atm(1)%parent_grid%global_tile)
then 938 call mpp_global_field( &
939 atm(1)%parent_grid%domain, &
940 atm(1)%parent_grid%delp(isd_p:ied_p,jsd_p:jed_p,:), g_dat, position=center)
941 if (gid == sending_proc)
then 942 do p=1,
size(atm(1)%pelist)
943 call mpp_send(g_dat,
size(g_dat),atm(1)%pelist(p))
947 if (any(atm(1)%pelist == gid))
then 948 call mpp_recv(g_dat,
size(g_dat), sending_proc)
953 atm(1)%neststruct%ind_h, atm(1)%neststruct%wt_h, &
954 0, 0, isg, ieg, jsg, jeg, npz, atm(1)%bd)
963 if (any(atm(1)%parent_grid%pelist == gid) .and. atm(1)%neststruct%parent_tile == atm(1)%parent_grid%global_tile)
then 964 call mpp_global_field( &
965 atm(1)%parent_grid%domain, &
966 atm(1)%parent_grid%q(isd_p:ied_p,jsd_p:jed_p,:,nq), g_dat, position=center)
967 if (gid == sending_proc)
then 968 do p=1,
size(atm(1)%pelist)
969 call mpp_send(g_dat,
size(g_dat),atm(1)%pelist(p))
973 if (any(atm(1)%pelist == gid))
then 974 call mpp_recv(g_dat,
size(g_dat), sending_proc)
979 atm(1)%neststruct%ind_h, atm(1)%neststruct%wt_h, &
980 0, 0, isg, ieg, jsg, jeg, npz, atm(1)%bd)
995 if (any(atm(1)%parent_grid%pelist == gid) .and. atm(1)%neststruct%parent_tile == atm(1)%parent_grid%global_tile)
then 996 call mpp_global_field( &
997 atm(1)%parent_grid%domain, &
998 atm(1)%parent_grid%pt(isd_p:ied_p,jsd_p:jed_p,:), g_dat, position=center)
999 if (gid == sending_proc)
then 1000 do p=1,
size(atm(1)%pelist)
1001 call mpp_send(g_dat,
size(g_dat),atm(1)%pelist(p))
1005 if (any(atm(1)%pelist == gid))
then 1006 call mpp_recv(g_dat,
size(g_dat), sending_proc)
1013 atm(1)%neststruct%ind_h, atm(1)%neststruct%wt_h, &
1014 0, 0, isg, ieg, jsg, jeg, npz, atm(1)%bd)
1017 if ( atm(1)%flagstruct%nwat > 0 )
then 1018 sphum = get_tracer_index(model_atmos,
'sphum')
1022 if ( atm(1)%parent_grid%flagstruct%adiabatic .or. atm(1)%parent_grid%flagstruct%do_Held_Suarez )
then 1025 zvir = rvgas/rdgas - 1.
1030 if (any(atm(1)%parent_grid%pelist == gid) .and. atm(1)%neststruct%parent_tile == atm(1)%parent_grid%global_tile)
then 1031 call mpp_global_field( &
1032 atm(1)%parent_grid%domain, &
1033 atm(1)%parent_grid%pkz(isc_p:iec_p,jsc_p:jec_p,:), g_dat, position=center)
1034 if (gid == sending_proc)
then 1035 do p=1,
size(atm(1)%pelist)
1036 call mpp_send(g_dat,
size(g_dat),atm(1)%pelist(p))
1040 if (any(atm(1)%pelist == gid))
then 1041 call mpp_recv(g_dat,
size(g_dat), sending_proc)
1048 allocate(pt_coarse(isd:ied,jsd:jed,npz))
1050 atm(1)%neststruct%ind_h, atm(1)%neststruct%wt_h, &
1051 0, 0, isg, ieg, jsg, jeg, npz, atm(1)%bd)
1053 if (atm(1)%bd%is == 1)
then 1055 do j=atm(1)%bd%jsd,atm(1)%bd%jed
1056 do i=atm(1)%bd%isd,0
1058 atm(1)%pt(i,j,k) = cp_air*atm(1)%pt(i,j,k)/pt_coarse(i,j,k)*
virq(atm(1)%q(i,j,k,:))
1060 atm(1)%pt(i,j,k) = cp_air*atm(1)%pt(i,j,k)/pt_coarse(i,j,k)*(1.+zvir*atm(1)%q(i,j,k,sphum))
1067 if (atm(1)%bd%js == 1)
then 1068 if (atm(1)%bd%is == 1)
then 1069 istart = atm(1)%bd%is
1071 istart = atm(1)%bd%isd
1073 if (atm(1)%bd%ie == atm(1)%npx-1)
then 1076 iend = atm(1)%bd%ied
1080 do j=atm(1)%bd%jsd,0
1083 atm(1)%pt(i,j,k) = cp_air*atm(1)%pt(i,j,k)/pt_coarse(i,j,k)*
virq(atm(1)%q(i,j,k,:))
1085 atm(1)%pt(i,j,k) = cp_air*atm(1)%pt(i,j,k)/pt_coarse(i,j,k)*(1.+zvir*atm(1)%q(i,j,k,sphum))
1092 if (atm(1)%bd%ie == atm(1)%npx-1)
then 1094 do j=atm(1)%bd%jsd,atm(1)%bd%jed
1095 do i=atm(1)%npx,atm(1)%bd%ied
1097 atm(1)%pt(i,j,k) = cp_air*atm(1)%pt(i,j,k)/pt_coarse(i,j,k)*
virq(atm(1)%q(i,j,k,:))
1099 atm(1)%pt(i,j,k) = cp_air*atm(1)%pt(i,j,k)/pt_coarse(i,j,k)*(1.+zvir*atm(1)%q(i,j,k,sphum))
1106 if (atm(1)%bd%je == atm(1)%npy-1)
then 1107 if (atm(1)%bd%is == 1)
then 1108 istart = atm(1)%bd%is
1110 istart = atm(1)%bd%isd
1112 if (atm(1)%bd%ie == atm(1)%npx-1)
then 1115 iend = atm(1)%bd%ied
1119 do j=atm(1)%npy,atm(1)%bd%jed
1122 atm(1)%pt(i,j,k) = cp_air*atm(1)%pt(i,j,k)/pt_coarse(i,j,k)*
virq(atm(1)%q(i,j,k,:))
1124 atm(1)%pt(i,j,k) = cp_air*atm(1)%pt(i,j,k)/pt_coarse(i,j,k)*(1.+zvir*atm(1)%q(i,j,k,sphum))
1131 deallocate(pt_coarse)
1135 if (.not. atm(1)%flagstruct%hydrostatic)
then 1140 if (any(atm(1)%parent_grid%pelist == gid) .and. atm(1)%neststruct%parent_tile == atm(1)%parent_grid%global_tile)
then 1141 call mpp_global_field( &
1142 atm(1)%parent_grid%domain, &
1143 atm(1)%parent_grid%delz(isd_p:ied_p,jsd_p:jed_p,:), g_dat, position=center)
1144 if (gid == sending_proc)
then 1145 do p=1,
size(atm(1)%pelist)
1146 call mpp_send(g_dat,
size(g_dat),atm(1)%pelist(p))
1150 if (any(atm(1)%pelist == gid))
then 1151 call mpp_recv(g_dat,
size(g_dat), sending_proc)
1158 atm(1)%neststruct%ind_h, atm(1)%neststruct%wt_h, &
1159 0, 0, isg, ieg, jsg, jeg, npz, atm(1)%bd)
1165 if (any(atm(1)%parent_grid%pelist == gid) .and. atm(1)%neststruct%parent_tile == atm(1)%parent_grid%global_tile)
then 1166 call mpp_global_field( &
1167 atm(1)%parent_grid%domain, &
1168 atm(1)%parent_grid%w(isd_p:ied_p,jsd_p:jed_p,:), g_dat, position=center)
1169 if (gid == sending_proc)
then 1170 do p=1,
size(atm(1)%pelist)
1171 call mpp_send(g_dat,
size(g_dat),atm(1)%pelist(p))
1175 if (any(atm(1)%pelist == gid))
then 1176 call mpp_recv(g_dat,
size(g_dat), sending_proc)
1183 atm(1)%neststruct%ind_h, atm(1)%neststruct%wt_h, &
1184 0, 0, isg, ieg, jsg, jeg, npz, atm(1)%bd)
1194 allocate(g_dat( isg:ieg, jsg:jeg+1, npz) )
1199 if (any(atm(1)%parent_grid%pelist == gid) .and. atm(1)%neststruct%parent_tile == atm(1)%parent_grid%global_tile)
then 1200 call mpp_global_field( &
1201 atm(1)%parent_grid%domain, &
1202 atm(1)%parent_grid%u(isd_p:ied_p,jsd_p:jed_p+1,:), g_dat, position=north)
1203 if (gid == sending_proc)
then 1204 do p=1,
size(atm(1)%pelist)
1205 call mpp_send(g_dat,
size(g_dat),atm(1)%pelist(p))
1209 if (any(atm(1)%pelist == gid))
then 1210 call mpp_recv(g_dat,
size(g_dat), sending_proc)
1218 atm(1)%neststruct%ind_u, atm(1)%neststruct%wt_u, &
1219 0, 1, isg, ieg, jsg, jeg, npz, atm(1)%bd)
1224 allocate(g_dat( isg:ieg+1, jsg:jeg, npz) )
1229 if (any(atm(1)%parent_grid%pelist == gid) .and. atm(1)%neststruct%parent_tile == atm(1)%parent_grid%global_tile)
then 1230 call mpp_global_field( &
1231 atm(1)%parent_grid%domain, &
1232 atm(1)%parent_grid%v(isd_p:ied_p+1,jsd_p:jed_p,:), g_dat, position=east)
1233 if (gid == sending_proc)
then 1234 do p=1,
size(atm(1)%pelist)
1235 call mpp_send(g_dat,
size(g_dat),atm(1)%pelist(p))
1239 if (any(atm(1)%pelist == gid))
then 1240 call mpp_recv(g_dat,
size(g_dat), sending_proc)
1247 atm(1)%neststruct%ind_v, atm(1)%neststruct%wt_v, &
1248 1, 0, isg, ieg, jsg, jeg, npz, atm(1)%bd)
1258 logical,
intent(IN),
OPTIONAL :: proc_in
1259 real,
allocatable :: g_dat(:,:,:), pt_coarse(:,:,:)
1260 integer :: i,j,k,nq, sphum, ncnst, istart, iend, npz
1261 integer :: isc, iec, jsc, jec, isd, ied, jsd, jed
1262 integer :: isd_p, ied_p, jsd_p, jed_p, isc_p, iec_p, jsc_p, jec_p
1263 integer :: isg, ieg, jsg,jeg, npx_p, npy_p
1264 integer :: isg_n, ieg_n, jsg_n, jeg_n, npx_n, npy_n
1267 integer :: p , sending_proc
1270 if (
present(proc_in))
then 1281 isc = atm%bd%isc; iec = atm%bd%iec; jsc = atm%bd%jsc; jec = atm%bd%jec
1284 isd_p = atm%parent_grid%bd%isd
1285 ied_p = atm%parent_grid%bd%ied
1286 jsd_p = atm%parent_grid%bd%jsd
1287 jed_p = atm%parent_grid%bd%jed
1288 isc_p = atm%parent_grid%bd%isc
1289 iec_p = atm%parent_grid%bd%iec
1290 jsc_p = atm%parent_grid%bd%jsc
1291 jec_p = atm%parent_grid%bd%jec
1292 sending_proc = atm%parent_grid%pelist(1) + (atm%neststruct%parent_tile-1)*atm%parent_grid%npes_per_tile
1294 call mpp_get_global_domain( atm%parent_grid%domain, &
1295 isg, ieg, jsg, jeg, xsize=npx_p, ysize=npy_p)
1300 if ( process )
call mpp_update_domains(atm%phis, atm%domain, complete=.true.)
1301 if (atm%neststruct%twowaynest)
then 1302 if (any(atm%parent_grid%pelist == mpp_pe()) .or. atm%neststruct%child_proc)
then 1304 atm%phis, global_nest_domain, &
1305 atm%gridstruct%dx, atm%gridstruct%dy, atm%gridstruct%area, &
1306 atm%bd, isd_p, ied_p, jsd_p, jed_p, isd, ied, jsd, jed, &
1307 atm%neststruct%isu, atm%neststruct%ieu, atm%neststruct%jsu, atm%neststruct%jeu, &
1308 atm%npx, atm%npy, 0, 0, &
1309 atm%neststruct%refinement, atm%neststruct%nestupdate, 0, 0, &
1310 atm%neststruct%parent_proc, atm%neststruct%child_proc, atm%parent_grid, atm%grid_number-1)
1311 atm%parent_grid%neststruct%parent_of_twoway = .true.
1316 if (atm%neststruct%parent_proc)
call mpp_update_domains(atm%parent_grid%phis, atm%parent_grid%domain)
1336 if (process)
call p_var(npz, isc, iec, jsc, jec, atm%ptop,
ptop_min, atm%delp, &
1337 atm%delz, atm%pt, atm%ps, &
1338 atm%pe, atm%peln, atm%pk, atm%pkz, kappa, atm%q, &
1339 atm%ng, ncnst, atm%gridstruct%area_64, atm%flagstruct%dry_mass, .false., atm%flagstruct%mountain, &
1340 atm%flagstruct%moist_phys, .true., atm%flagstruct%nwat, atm%domain, atm%flagstruct%adiabatic)
1352 character(len=*),
intent(in) :: timestamp
1355 if (atm%neststruct%nested)
then 1366 logical,
intent(in) :: restart_endfcst
1368 integer :: isc, iec, jsc, jec
1369 integer :: iq, ncnst, ntprog, ntdiag
1370 integer :: isd, ied, jsd, jed, npz
1372 integer :: file_unit
1373 integer,
allocatable :: pelist(:)
1374 character(len=128):: tracer_name
1375 character(len=3):: gn
1377 call mpp_set_current_pelist(atm%pelist)
1379 isc = atm%bd%isc; iec = atm%bd%iec; jsc = atm%bd%jsc; jec = atm%bd%jec
1387 ntprog =
size(atm%q,4)
1388 ntdiag =
size(atm%qdiag,4)
1390 if (atm%grid_number > 1)
then 1391 write(gn,
'(A2, I1)')
" g", atm%grid_number
1398 write(unit,*)
'fv_restart_end u ', trim(gn),
' = ', mpp_chksum(atm%u(isc:iec,jsc:jec,:))
1399 write(unit,*)
'fv_restart_end v ', trim(gn),
' = ', mpp_chksum(atm%v(isc:iec,jsc:jec,:))
1400 if ( .not. atm%flagstruct%hydrostatic ) &
1401 write(unit,*)
'fv_restart_end w ', trim(gn),
' = ', mpp_chksum(atm%w(isc:iec,jsc:jec,:))
1402 write(unit,*)
'fv_restart_end delp', trim(gn),
' = ', mpp_chksum(atm%delp(isc:iec,jsc:jec,:))
1403 write(unit,*)
'fv_restart_end phis', trim(gn),
' = ', mpp_chksum(atm%phis(isc:iec,jsc:jec))
1405 write(unit,*)
'fv_restart_end pt ', trim(gn),
' = ', mpp_chksum(atm%pt(isc:iec,jsc:jec,:))
1407 write(unit,*)
'fv_restart_end q(prog) nq ', trim(gn),
' =',ntprog, mpp_chksum(atm%q(isc:iec,jsc:jec,:,:))
1409 write(unit,*)
'fv_restart_end q(diag) nq ', trim(gn),
' =',ntdiag, mpp_chksum(atm%qdiag(isc:iec,jsc:jec,:,:))
1410 do iq=1,min(17, ntprog)
1411 call get_tracer_names(model_atmos, iq, tracer_name)
1412 write(unit,*)
'fv_restart_end '//trim(tracer_name)// trim(gn),
' = ', mpp_chksum(atm%q(isc:iec,jsc:jec,:,iq))
1419 call pmaxmn_g(
'ZS', atm%phis, isc, iec, jsc, jec, 1, 1./grav, atm%gridstruct%area_64, atm%domain)
1420 call pmaxmn_g(
'PS ', atm%ps, isc, iec, jsc, jec, 1, 0.01 , atm%gridstruct%area_64, atm%domain)
1421 call prt_maxmin(
'PS*', atm%ps, isc, iec, jsc, jec, atm%ng, 1, 0.01)
1422 call prt_maxmin(
'U ', atm%u(isd:ied,jsd:jed,1:npz), isc, iec, jsc, jec, atm%ng, npz, 1.)
1423 call prt_maxmin(
'V ', atm%v(isd:ied,jsd:jed,1:npz), isc, iec, jsc, jec, atm%ng, npz, 1.)
1424 if ( .not. atm%flagstruct%hydrostatic ) &
1425 call prt_maxmin(
'W ', atm%w , isc, iec, jsc, jec, atm%ng, npz, 1.)
1426 call prt_maxmin(
'T ', atm%pt, isc, iec, jsc, jec, atm%ng, npz, 1.)
1428 call get_tracer_names ( model_atmos, iq, tracer_name )
1429 call pmaxmn_g(trim(tracer_name), atm%q(isd:ied,jsd:jed,1:npz,iq:iq), isc, iec, jsc, jec, npz, &
1430 1., atm%gridstruct%area_64, atm%domain)
1435 if ( restart_endfcst )
then 1439 if(atm%flagstruct%write_restart_with_bcs)
then 1446 if( is_master() )
then 1447 write(*,*) steps,
'Mean equivalent Heat flux for this integration period=',atm(1)%idiag%efx_sum/
real(max(1,Atm(1)%idiag%steps)), &
1448 'Mean nesting-related flux for this integration period=',Atm(1)%idiag%efx_sum_nest/
real(max(1,Atm(1)%idiag%steps)), &
1449 'Mean mountain torque=',Atm(1)%idiag%mtq_sum/
real(max(1,atm(1)%idiag%steps))
1450 file_unit = get_unit()
1451 open (unit=file_unit, file=
'e_flux.data', form=
'unformatted',status=
'unknown', access=
'sequential')
1453 write(file_unit) atm(1)%idiag%efx(n)
1454 write(file_unit) atm(1)%idiag%mtq(n)
1457 close(unit=file_unit)
1464 subroutine pmaxmn_g(qname, q, is, ie, js, je, km, fac, area, domain)
1465 character(len=*),
intent(in):: qname
1466 integer,
intent(in):: is, ie, js, je
1467 integer,
intent(in):: km
1468 real,
intent(in):: q(is-3:ie+3, js-3:je+3, km)
1469 real,
intent(in):: fac
1470 real(kind=R_GRID),
intent(IN):: area(is-3:ie+3, js-3:je+3)
1471 type(domain2d),
intent(INOUT) :: domain
1473 real qmin, qmax, gmean
1485 if( q(i,j,k) < qmin)
then 1487 elseif( q(i,j,k) > qmax )
then 1494 call mp_reduce_min(qmin)
1495 call mp_reduce_max(qmax)
1497 gmean =
g_sum(domain, q(is:ie,js:je,km), is, ie, js, je, 3, area, 1, .true.)
1498 if(is_master())
write(6,*) qname, qmax*fac, qmin*fac, gmean*fac
subroutine, public fv_io_read_bcs(Atm)
subroutine, public init_double_periodic(u, v, w, pt, delp, q, phis, ps, pe, peln, pk, pkz, uc, vc, ua, va, ak, bk, gridstruct, flagstruct, npx, npy, npz, ng, ncnst, nwat, ndims, nregions, dry_mass, mountain, moist_phys, hydrostatic, hybrid_z, delz, ze0, ks, ptop, domain_in, tile_in, bd)
subroutine, public init_case(u, v, w, pt, delp, q, phis, ps, pe, peln, pk, pkz, uc, vc, ua, va, ak, bk, gridstruct, flagstruct, npx, npy, npz, ng, ncnst, nwat, ndims, nregions, dry_mass, mountain, moist_phys, hydrostatic, hybrid_z, delz, ze0, adiabatic, ks, npx_global, ptop, domain_in, tile_in, bd)
The module 'fv_mp_mod' is a single program multiple data (SPMD) parallel decompostion/communication m...
subroutine timing_off(blk_name)
The subroutine 'timing_off' stops a timer.
logical module_is_initialized
The interface'update_coarse_grid_mpp'contains subroutines that fetch data from the nested grid and in...
subroutine fill_nested_grid_data(Atm, proc_in)
subroutine, public fv_io_init()
Initialize the fv core restart facilities.
real(kind=r_grid), parameter cnst_0p20
The module 'multi_gases' peforms multi constitutents computations.
subroutine, public del2_cubed_sphere(npx, npy, q, area, dx, dy, dxc, dyc, sin_sg, nmax, cd, zero_ocean, oro, bounded_domain, domain, bd)
subroutine, public set_hybrid_z(is, ie, js, je, ng, km, ztop, dz, rgrav, hs, ze, dz3)
subroutine, public p_var(km, ifirst, ilast, jfirst, jlast, ptop, ptop_min, delp, delz, pt, ps, pe, peln, pk, pkz, cappa, q, ng, nq, area, dry_mass, adjust_dry_mass, mountain, moist_phys, hydrostatic, nwat, domain, adiabatic, make_nh)
the subroutine 'p_var' computes auxiliary pressure variables for a hydrostatic state.
real function, public g_sum(domain, p, ifirst, ilast, jfirst, jlast, ngc, area, mode, reproduce)
The function 'g_sum' is the fast version of 'globalsum'.
subroutine, public fv_io_read_restart(fv_domain, Atm)
Write the fv core restart quantities.
The module 'fv_io' contains restart facilities for FV core.
integer, parameter, public r_grid
subroutine, public fv_io_register_restart(fv_domain, Atm)
The subroutine 'fv_io_register_restart' registers model restart fields.
subroutine, public fv_io_register_restart_bcs(Atm)
The subroutine 'fv_io_register_restart_BCs' registers restarts for nested-grid boundary conditions...
subroutine, public read_da_inc(Atm, fv_domain, bd, npz_in, nq, u, v, q, delp, pt, delz, is_in, js_in, ie_in, je_in, isc_in, jsc_in, iec_in, jec_in)
The subroutine 'read_da_inc' reads the increments of the diagnostic variables from the DA-generated f...
subroutine, public make_eta_level(km, pe, area, kks, ak, bk, ptop, domain, bd)
The module 'fv_timing' contains FV3 timers.
pure real function, public virq(q)
The module 'boundary' contains utility routines for grid nesting and boundary conditions.
subroutine, public fv_restart_init()
subroutine, public fv_write_restart(Atm, timestamp)
The subroutine 'fv_write_restart' writes restart files to disk.
subroutine fill_nested_grid_topo(Atm, proc_in)
The subroutine 'fill_nested_grid_topo' fills the nested grid with topo to enable boundary smoothing...
subroutine, public fv_restart(fv_domain, Atm, dt_atmos, seconds, days, cold_start, grid_type, this_grid)
The subroutine 'fv_restart' initializes the model state, including prognaostic variables and several ...
real, parameter, public ptop_min
subroutine, public compute_dz_l32(km, ztop, dz)
subroutine, public cubed_to_latlon(u, v, ua, va, gridstruct, npx, npy, km, mode, grid_type, domain, bounded_domain, c2l_ord, bd)
The module 'fv_arrays' contains the 'fv_atmos_type' and associated datatypes.
real function, public great_circle_dist(q1, q2, radius)
interface 'nested_grid_BC' includes subroutines 'nested_grid_BC_2d' and 'nested_grid_BC_3d' that fetc...
The module 'fv_eta' contains routine to set up the reference (Eulerian) pressure coordinate.
The module 'external_ic_mod' contains routines that read in and remap initial conditions.
subroutine, public fv_io_write_bcs(Atm, timestamp)
subroutine, public compute_dz_var(km, ztop, dz)
The interface 'fill_nested_grid' includes subroutines 'fill_nested_grid_2d' and 'fill_nested_grid_3d'...
'The module 'tread_da_increment' contains routines for treating the increments of the prognostic vari...
real, dimension(:,:), allocatable, public sgh_g
subroutine timing_on(blk_name)
The subroutine 'timing_on' starts a timer.
@ The module 'fv_diagnostics' contains routines to compute diagnosic fields.
subroutine, public fv_io_register_nudge_restart(Atm)
The subroutine 'fv_io_register_nudge_restart' registers restarts for SST fields used in HiRAM...
The module 'fv_grid_utils' contains routines for setting up and computing grid-related quantities...
subroutine, public write_full_fields(Atm)
real, dimension(:,:), allocatable, public oro_g
subroutine, public get_external_ic(Atm, fv_domain, cold_start, dt_atmos)
subroutine, public prt_maxmin(qname, q, is, ie, js, je, n_g, km, fac)
subroutine, public fv_io_write_restart(Atm, timestamp)
The subroutine 'fv_io_write_restart' writes restart files.
subroutine fill_nested_grid_topo_halo(Atm, proc_in)
subroutine, public remap_restart(fv_domain, Atm)
The subroutine 'remap_restart' remaps the model state from remap files to a new set of Eulerian coord...
subroutine pmaxmn_g(qname, q, is, ie, js, je, km, fac, area, domain)
subroutine, public del4_cubed_sphere(npx, npy, q, area, dx, dy, dxc, dyc, sin_sg, nmax, zero_ocean, oro, bounded_domain, domain, bd)
subroutine twoway_topo_update(Atm, proc_in)
The subroutine ' twoway_topo_update' actually sets up the coarse-grid TOPOGRAPHY. ...
subroutine, public fv_restart_end(Atm, restart_endfcst)
The subroutine 'fv_restart_end' writes ending restart files, terminates I/O, and prints out diagnosti...