Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/aoloso/hybrid 012924 #892

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

module gfdl2_cloud_microphys_mod

use mpp_mod, only: mpp_pe, mpp_root_pe
! use mpp_mod, only: mpp_pe, mpp_root_pe
! use mpp_mod, only: stdlog, mpp_pe, mpp_root_pe, mpp_clock_id, &
! mpp_clock_begin, mpp_clock_end, clock_routine, &
! input_nml_file
Expand All @@ -46,10 +46,11 @@ module gfdl2_cloud_microphys_mod
! use fms_mod, only: write_version_number, open_namelist_file, &
! check_nml_error, file_exist, close_file

use fms_mod, only: write_version_number, open_namelist_file, &
check_nml_error, close_file, file_exist, &
fms_init
!use fms_mod, only: write_version_number, open_namelist_file, &
! check_nml_error, close_file, file_exist, &
! fms_init
use GEOSmoist_Process_Library, only: sigma, ice_fraction
use MAPL, only: MAPL_AM_I_ROOT

implicit none

Expand Down Expand Up @@ -397,7 +398,6 @@ subroutine gfdl_cloud_microphys_driver (qv, ql, qr, qi, qs, qg, qa, qn, &
real, dimension (iie - iis + 1, jje - jjs + 1, kke - kks + 1) :: vt_r, vt_s, vt_g, vt_i, qn2

real :: allmax

is = 1
js = 1
ks = 1
Expand Down Expand Up @@ -3380,7 +3380,7 @@ subroutine gfdl_cloud_microphys_init (comm)
! logical :: flag
! real :: tmp, q1, q2

call fms_init(comm)
!call fms_init(comm)

! root_proc = (mpp_pe () .eq.mpp_root_pe ())

Expand All @@ -3392,88 +3392,35 @@ subroutine gfdl_cloud_microphys_init (comm)
write (6, *) 'gfdl - mp :: namelist file: ', trim (fn_nml), ' does not exist'
stop
else
nlunit=open_namelist_file()
rewind (nlunit)
!nlunit=open_namelist_file()
!rewind (nlunit)
open(NEWUNIT=nlunit,file=trim(fn_nml), form='formatted',access='sequential',iostat=ios)
if(ios /= 0) stop 'open namelist file gfdl_cloud_microphys_init failed, bailing out...'
rewind (nlunit, iostat=ios)
if(ios /= 0) stop 'rewind namelist file gfdl_cloud_microphys_init failed, bailing out...'
! Read Main namelist
read (nlunit,gfdl_cloud_microphysics_nml,iostat=ios)
ierr = check_nml_error(ios,'gfdl_cloud_microphysics_nml')
call close_file(nlunit)
if(ios /= 0) stop 'read namelist gfdl_cloud_microphys_init failed, bailing out...'
!ierr = check_nml_error(ios,'gfdl_cloud_microphysics_nml')
!call close_file(nlunit)
close(nlunit, iostat=ios)
if(ios /= 0) stop 'close namelist file gfdl_cloud_microphys_init failed, bailing out...'
endif
#endif

if (mpp_pe() .EQ. mpp_root_pe()) then
if (MAPL_AM_I_ROOT()) then
write (*, *) " ================================================================== "
write (*, *) "gfdl_cloud_microphys_mod"
write (*, nml = gfdl_cloud_microphysics_nml)
write (*, *) " ================================================================== "
endif

! write version number and namelist to log file
!if (me == root_proc) then
! write (logunit, *) " ================================================================== "
! write (logunit, *) "gfdl_cloud_microphys_mod"
! write (logunit, nml = gfdl_cloud_microphysics_nml)
!endif

if (do_setup) then
call setup_con
call setupm
do_setup = .false.
endif

! if (root_proc) write (logunit, nml = gfdl_cloud_microphys_nml)
!
! id_vtr = register_diag_field (mod_name, 'vt_r', axes (1:3), time, &
! 'rain fall speed', 'm / s', missing_value = missing_value)
! id_vts = register_diag_field (mod_name, 'vt_s', axes (1:3), time, &
! 'snow fall speed', 'm / s', missing_value = missing_value)
! id_vtg = register_diag_field (mod_name, 'vt_g', axes (1:3), time, &
! 'graupel fall speed', 'm / s', missing_value = missing_value)
! id_vti = register_diag_field (mod_name, 'vt_i', axes (1:3), time, &
! 'ice fall speed', 'm / s', missing_value = missing_value)

! id_droplets = register_diag_field (mod_name, 'droplets', axes (1:3), time, &
! 'droplet number concentration', '# / m3', missing_value = missing_value)
! id_rh = register_diag_field (mod_name, 'rh_lin', axes (1:2), time, &
! 'relative humidity', 'n / a', missing_value = missing_value)

! id_rain = register_diag_field (mod_name, 'rain_lin', axes (1:2), time, &
! 'rain_lin', 'mm / day', missing_value = missing_value)
! id_snow = register_diag_field (mod_name, 'snow_lin', axes (1:2), time, &
! 'snow_lin', 'mm / day', missing_value = missing_value)
! id_graupel = register_diag_field (mod_name, 'graupel_lin', axes (1:2), time, &
! 'graupel_lin', 'mm / day', missing_value = missing_value)
! id_ice = register_diag_field (mod_name, 'ice_lin', axes (1:2), time, &
! 'ice_lin', 'mm / day', missing_value = missing_value)
! id_prec = register_diag_field (mod_name, 'prec_lin', axes (1:2), time, &
! 'prec_lin', 'mm / day', missing_value = missing_value)

! if (root_proc) write (*, *) 'prec_lin diagnostics initialized.', id_prec

! id_cond = register_diag_field (mod_name, 'cond_lin', axes (1:2), time, &
! 'total condensate', 'kg / m ** 2', missing_value = missing_value)
! id_var = register_diag_field (mod_name, 'var_lin', axes (1:2), time, &
! 'subgrid variance', 'n / a', missing_value = missing_value)

! call qsmith_init

! testing the water vapor tables

! if (mp_debug .and. root_proc) then
! write (*, *) 'testing water vapor tables in gfdl_cloud_microphys'
! tmp = tice - 90.
! do k = 1, 25
! q1 = wqsat_moist (tmp, 0., 1.e5)
! q2 = qs1d_m (tmp, 0., 1.e5)
! write (*, *) nint (tmp - tice), q1, q2, 'dq = ', q1 - q2
! tmp = tmp + 5.
! enddo
! endif

! if (root_proc) write (*, *) 'gfdl_cloud_micrphys diagnostics initialized.'

! gfdl_mp_clock = mpp_clock_id ('gfdl_cloud_microphys', grain = clock_routine)

module_is_initialized = .true.

end subroutine gfdl_cloud_microphys_init
Expand Down