36 subroutine gfs_rrtmgp_setup_init(do_RRTMGP, imp_physics, imp_physics_fer_hires, &
37 imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_zhao_carr, &
38 imp_physics_zhao_carr_pdf, imp_physics_mg, si, levr, ictm, isol, ico2, iaer, &
39 ntcw, ntoz, iovr, isubc_sw, isubc_lw, lalw1bd, idate, &
40 me, aeros_file, iaermdl, iaerflg, con_pi, con_t0c, con_c, con_boltz, con_plnk, &
41 solar_file, con_solr_2008, con_solr_2002, co2usr_file, co2cyc_file, ipsd0, &
45 logical,
intent(in) :: do_rrtmgp
46 integer,
intent(in) :: &
47 imp_physics, & !< Flag for MP scheme
48 imp_physics_fer_hires, & !< Flag for fer-hires scheme
49 imp_physics_gfdl, & !< Flag for gfdl scheme
50 imp_physics_thompson, & !< Flag for thompsonscheme
51 imp_physics_wsm6, & !< Flag for wsm6 scheme
52 imp_physics_zhao_carr, & !< Flag for zhao-carr scheme
53 imp_physics_zhao_carr_pdf, & !< Flag for zhao-carr+PDF scheme
55 real(kind_phys),
intent(in) :: &
56 con_pi, con_t0c, con_c, con_boltz, con_plnk, con_solr_2008, con_solr_2002
57 real(kind_phys),
dimension(:),
intent(in) :: &
59 integer,
intent(in) :: levr, ictm, isol, ico2, iaer, ntcw, ntoz, iovr, isubc_sw, isubc_lw, me
60 logical,
intent(in) :: &
62 integer,
intent(in),
dimension(:) :: &
64 character(len=26),
intent(in) :: aeros_file, solar_file, co2usr_file, co2cyc_file
67 character(len=*),
intent(out) :: errmsg
68 integer,
intent(out) :: errflg
69 integer,
intent(inout) :: ipsd0
70 integer,
intent(out) :: iaermdl, iaerflg
77 if (.not. do_rrtmgp)
then
78 write(errmsg,
'(*(a))')
"Logic error: do_RRTMGP must be set to .true."
84 if ( ictm==0 .or. ictm==-2 )
then
85 iaerflg = mod(iaer, 100)
87 iaerflg = mod(iaer, 1000)
90 if ( iaermdl < 0 .or. (iaermdl>2 .and. iaermdl/=5) )
then
91 errmsg = trim(errmsg) //
' Error -- IAER flag is incorrect, Abort'
97 if ( isubc_sw>0 .or. isubc_lw>0 )
then
98 ipsd0 = 17*idate(1)+43*idate(2)+37*idate(3)+23*idate(4)
102 print *,
' In rad_initialize (GFS_rrtmgp_setup_init), before calling radinit'
104 print *,
' levr = ',levr, &
108 ' iaermdl = ',iaermdl, &
109 ' iaerflg = ',iaerflg, &
113 ' isubc_sw = ',isubc_sw, &
114 ' isubc_lw = ',isubc_lw, &
124 if (is_initialized)
return
127 call sol_init ( me, isol, solar_file, con_solr_2008, con_solr_2002, con_pi )
128 call aer_init ( levr, me, iaermdl, iaerflg, lalw1bd, aeros_file, con_pi, con_t0c, &
129 con_c, con_boltz, con_plnk, errflg, errmsg)
130 call gas_init ( me, co2usr_file, co2cyc_file, ico2, ictm, con_pi, errflg, errmsg )
133 print *,
' return from rad_initialize (GFS_rrtmgp_setup_init) - after calling radinit'
136 is_initialized = .true.
143 subroutine gfs_rrtmgp_setup_timestep_init (idate, jdate, deltsw, deltim, doSWrad, me, &
144 iaermdl, aeros_file, isol, slag, sdec, cdec, solcon, con_pi, co2dat_file, &
145 co2gbl_file, ictm, ico2, ntoz, ozphys, errmsg, errflg)
148 integer,
intent(in) :: idate(:)
149 integer,
intent(in) :: jdate(:)
150 real(kind_phys),
intent(in) :: deltsw
151 real(kind_phys),
intent(in) :: deltim
152 logical,
intent(in) :: doswrad
153 real(kind_phys),
intent(in) :: con_pi
154 integer,
intent(in) :: me
155 integer,
intent(in) :: iaermdl,isol,ictm,ico2,ntoz
156 character(len=26),
intent(in) :: aeros_file,co2dat_file,co2gbl_file
159 real(kind_phys),
intent(out) :: slag
160 real(kind_phys),
intent(out) :: sdec
161 real(kind_phys),
intent(out) :: cdec
162 real(kind_phys),
intent(out) :: solcon
163 character(len=*),
intent(out) :: errmsg
164 integer,
intent(out) :: errflg
167 integer :: iyear, imon, iday, ihour
168 integer :: kyear, kmon, kday, khour
178 if (.not.is_initialized)
then
179 write(errmsg, fmt=
'((a))')
'GFS_rrtmgp_setup_timestep_init called before GFS_rrtmgp_setup_init'
192 if ( ictm==0 .or. ictm==-2 )
then
205 if ( month0 /= imon )
then
214 if ( isol == 0 .or. isol == 10 )
then
216 elseif ( iyear0 /= iyear )
then
219 lsol_chg = ( isol==4 .and. lmon_chg )
222 call sol_update(jdate, kyear, deltsw, deltim, lsol_chg, me, slag, sdec, cdec, solcon, con_pi, errmsg, errflg)
227 call aer_update ( iyear, imon, me, iaermdl, aeros_file, errflg, errmsg)
231 if ( monthd /= kmon )
then
237 call gas_update (kyear, kmon, kday, khour, lco2_chg, me, co2dat_file, co2gbl_file, ictm,&
238 ico2, errflg, errmsg )
240 call ozphys%update_o3clim(kmon, kday, khour, loz1st)
243 if ( loz1st ) loz1st = .false.
subroutine, public sol_update(jdate, kyear, deltsw, deltim, lsol_chg, me, slag, sdec, cdec, solcon, con_pi, errmsg, errflg)
This subroutine computes solar parameters at forecast time.
subroutine, public gas_update(iyear, imon, iday, ihour, ldoco2, me, co2dat_file, co2gbl_file, ictmflg, ico2flg, errflg, errmsg)
This subroutine reads in 2-d monthly co2 data set for a specified year. Data are in a 15 degree lat/l...