48 private :: profile_setup_cira86
49 private :: profile_setup_mipas2001
50 private :: readfile_mipas2001
51 private :: profile_read_climatology
52 private :: profile_read_cira86
53 private :: profile_read_mipas2001
54 private :: profile_read_user
55 private :: profile_interp
61 real(RP),
private :: profile_toa = 100.0_rp
62 character(len=H_LONG),
private :: profile_cira86_fname =
"cira.nc" 63 character(len=H_LONG),
private :: profile_mipas2001_dir =
"." 64 character(len=H_LONG),
private :: profile_user_fname =
"" 65 logical,
private :: atmos_phy_rd_profile_use_co2 = .true.
66 logical,
private :: atmos_phy_rd_profile_use_o3 = .true.
67 logical,
private :: atmos_phy_rd_profile_use_n2o = .true.
68 logical,
private :: atmos_phy_rd_profile_use_co = .true.
69 logical,
private :: atmos_phy_rd_profile_use_ch4 = .true.
70 logical,
private :: atmos_phy_rd_profile_use_o2 = .true.
71 logical,
private :: atmos_phy_rd_profile_use_cfc = .true.
72 logical,
private :: debug = .false.
74 integer,
private :: cira_ntime
75 integer,
private :: cira_nplev
76 integer,
private :: cira_nlat
77 real(RP),
private,
allocatable :: cira_nd (:)
78 real(RP),
private,
allocatable :: cira_plog(:)
79 real(RP),
private,
allocatable :: cira_lat (:)
80 real(RP),
private,
allocatable :: cira_temp(:,:,:)
81 real(RP),
private,
allocatable :: cira_z (:,:,:)
83 real(RP),
private,
allocatable :: interp_temp(:)
84 real(RP),
private,
allocatable :: interp_z (:)
86 integer,
private,
parameter :: mipas_kmax = 121
87 integer,
private,
parameter :: mipas_ntime = 2
88 real(RP),
private :: mipas_nd (0:mipas_ntime+1)
89 real(RP),
private :: mipas_lat (5)
90 real(RP),
private :: mipas_z (mipas_kmax,4)
91 real(RP),
private :: mipas_pres(mipas_kmax,4)
92 real(RP),
private :: mipas_temp(mipas_kmax,4)
93 real(RP),
private :: mipas_gas (mipas_kmax,30,4)
95 integer,
private,
parameter :: i_tropic = 1
96 integer,
private,
parameter :: i_midlat = 2
97 integer,
private,
parameter :: i_polarsum = 3
98 integer,
private,
parameter :: i_polarwin = 4
100 integer,
private,
parameter :: i_n2 = 1
101 integer,
private,
parameter :: i_o2 = 2
102 integer,
private,
parameter :: i_co2 = 3
103 integer,
private,
parameter :: i_o3 = 4
104 integer,
private,
parameter :: i_h2o = 5
105 integer,
private,
parameter :: i_ch4 = 6
106 integer,
private,
parameter :: i_n2o = 7
107 integer,
private,
parameter :: i_hno3 = 8
108 integer,
private,
parameter :: i_co = 9
109 integer,
private,
parameter :: i_no2 = 10
110 integer,
private,
parameter :: i_n2o5 = 11
111 integer,
private,
parameter :: i_clo = 12
112 integer,
private,
parameter :: i_hocl = 13
113 integer,
private,
parameter :: i_clono2 = 14
114 integer,
private,
parameter :: i_no = 15
115 integer,
private,
parameter :: i_hno4 = 16
116 integer,
private,
parameter :: i_hcn = 17
117 integer,
private,
parameter :: i_nh3 = 18
118 integer,
private,
parameter :: i_f11 = 19
119 integer,
private,
parameter :: i_f12 = 20
120 integer,
private,
parameter :: i_f14 = 21
121 integer,
private,
parameter :: i_f22 = 22
122 integer,
private,
parameter :: i_ccl4 = 23
123 integer,
private,
parameter :: i_cof2 = 24
124 integer,
private,
parameter :: i_h2o2 = 25
125 integer,
private,
parameter :: i_c2h2 = 26
126 integer,
private,
parameter :: i_c2h6 = 27
127 integer,
private,
parameter :: i_ocs = 28
128 integer,
private,
parameter :: i_so2 = 29
129 integer,
private,
parameter :: i_sf6 = 30
131 logical,
private :: report_firsttime = .true.
142 real(RP) :: ATMOS_PHY_RD_PROFILE_TOA
143 character(len=H_LONG) :: ATMOS_PHY_RD_PROFILE_CIRA86_IN_FILENAME
144 character(len=H_LONG) :: ATMOS_PHY_RD_PROFILE_MIPAS2001_IN_BASENAME
145 character(len=H_LONG) :: ATMOS_PHY_RD_PROFILE_USER_IN_FILENAME
147 namelist / param_atmos_phy_rd_profile / &
148 atmos_phy_rd_profile_toa, &
150 atmos_phy_rd_profile_cira86_in_filename, &
151 atmos_phy_rd_profile_mipas2001_in_basename, &
152 atmos_phy_rd_profile_user_in_filename, &
153 atmos_phy_rd_profile_use_co2, &
154 atmos_phy_rd_profile_use_o3, &
155 atmos_phy_rd_profile_use_n2o, &
156 atmos_phy_rd_profile_use_co, &
157 atmos_phy_rd_profile_use_ch4, &
158 atmos_phy_rd_profile_use_o2, &
159 atmos_phy_rd_profile_use_cfc, &
166 if(
io_l )
write(
io_fid_log,*)
'+++ Module[Physics-RD PROFILE]/Categ[ATMOS]' 169 atmos_phy_rd_profile_toa = profile_toa
170 atmos_phy_rd_profile_cira86_in_filename = profile_cira86_fname
171 atmos_phy_rd_profile_mipas2001_in_basename = profile_mipas2001_dir
172 atmos_phy_rd_profile_user_in_filename = profile_user_fname
176 read(
io_fid_conf,nml=param_atmos_phy_rd_profile,iostat=ierr)
179 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 180 elseif( ierr > 0 )
then 181 write(*,*)
'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_RD_PROFILE. Check!' 186 profile_toa = atmos_phy_rd_profile_toa
187 profile_cira86_fname = atmos_phy_rd_profile_cira86_in_filename
188 profile_mipas2001_dir = atmos_phy_rd_profile_mipas2001_in_basename
189 profile_user_fname = atmos_phy_rd_profile_user_in_filename
193 call profile_setup_cira86
195 call profile_setup_mipas2001
204 subroutine profile_setup_cira86
214 integer :: status, ncid, varid, dimid
216 integer,
allocatable :: CIRA_date(:,:)
219 real(DP) :: subsec = 0.0_dp
220 integer :: offset_year = 0
222 real(4),
allocatable :: tmp1d(:)
223 real(4),
allocatable :: tmp3d(:,:,:)
230 if(
io_l )
write(
io_fid_log,*)
'*** FILENAME:', trim(profile_cira86_fname)
232 inquire( file=trim(profile_cira86_fname), exist=exist )
233 if ( .NOT. exist )
then 239 status = nf90_open( profile_cira86_fname, nf90_nowrite, ncid )
242 status = nf90_inq_dimid( ncid,
"time", dimid )
244 status = nf90_inquire_dimension( ncid, dimid, len=cira_ntime )
247 status = nf90_inq_dimid( ncid,
"plev", dimid )
249 status = nf90_inquire_dimension( ncid, dimid, len=cira_nplev )
252 status = nf90_inq_dimid( ncid,
"latitude", dimid )
254 status = nf90_inquire_dimension( ncid, dimid, len=cira_nlat )
261 allocate( cira_nd( 0:cira_ntime+1) )
263 allocate( cira_plog(cira_nplev) )
264 allocate( cira_lat(cira_nlat ) )
266 allocate( cira_temp(cira_nplev,cira_nlat,0:cira_ntime+1) )
267 allocate( cira_z(cira_nplev,cira_nlat,0:cira_ntime+1) )
270 allocate( cira_date(6,0:cira_ntime+1) )
272 cira_date(:, 0) = (/ 1985, 12, 15, 12, 0, 0 /)
273 cira_date(:, 1) = (/ 1986, 1, 15, 12, 0, 0 /)
274 cira_date(:, 2) = (/ 1986, 2, 15, 12, 0, 0 /)
275 cira_date(:, 3) = (/ 1986, 3, 15, 12, 0, 0 /)
276 cira_date(:, 4) = (/ 1986, 4, 15, 12, 0, 0 /)
277 cira_date(:, 5) = (/ 1986, 5, 15, 12, 0, 0 /)
278 cira_date(:, 6) = (/ 1986, 6, 15, 12, 0, 0 /)
279 cira_date(:, 7) = (/ 1986, 7, 15, 12, 0, 0 /)
280 cira_date(:, 8) = (/ 1986, 8, 15, 12, 0, 0 /)
281 cira_date(:, 9) = (/ 1986, 9, 15, 12, 0, 0 /)
282 cira_date(:,10) = (/ 1986, 10, 15, 12, 0, 0 /)
283 cira_date(:,11) = (/ 1986, 11, 15, 12, 0, 0 /)
284 cira_date(:,12) = (/ 1986, 12, 15, 12, 0, 0 /)
285 cira_date(:,13) = (/ 1987, 1, 15, 12, 0, 0 /)
287 do t = 0, cira_ntime+1
289 cira_date(:,t), subsec, &
292 cira_nd(t) =
real(nday,kind=RP) + nsec / 86400.0_RP
294 deallocate( cira_date )
297 allocate( tmp1d(cira_nplev) )
299 status = nf90_inq_varid( ncid,
"plev", varid )
301 status = nf90_get_var( ncid, varid, tmp1d(:) )
305 cira_plog(n) =
log(
real(tmp1d(n),kind=RP) )
310 allocate( tmp1d(cira_nlat) )
312 status = nf90_inq_varid( ncid,
"latitude", varid )
314 status = nf90_get_var( ncid, varid, tmp1d(:) )
318 cira_lat(n) =
real(tmp1d(n),kind=RP) * CONST_D2R
327 allocate( tmp3d(cira_nlat,cira_nplev,cira_ntime) )
329 status = nf90_inq_varid( ncid,
"ta", varid )
331 status = nf90_get_var( ncid, varid, tmp3d(:,:,:) )
337 cira_temp(n,m,t) =
real(tmp3d(m,n,t),kind=
rp)
342 cira_temp(:,:,0 ) = cira_temp(:,:,cira_ntime)
343 cira_temp(:,:,cira_ntime+1) = cira_temp(:,:,1 )
349 if( cira_temp(n,m,t) >= 999.9_rp ) cira_temp(n,m,t) = cira_temp(n-1,m,t)
357 status = nf90_inq_varid( ncid,
"zg", varid )
359 status = nf90_get_var( ncid, varid, tmp3d(:,:,:) )
365 cira_z(n,m,t) =
real(tmp3d(m,n,t),kind=RP) * 1.E-3_RP
370 cira_z(:,:,0 ) = cira_z(:,:,cira_ntime)
371 cira_z(:,:,cira_ntime+1) = cira_z(:,:,1 )
377 if( cira_z(n,m,t) == 0.999_rp ) cira_z(n,m,t) = cira_z(n-1,m,t)
385 status = nf90_close(ncid)
388 allocate( interp_temp(cira_nplev) )
389 allocate( interp_z(cira_nplev) )
392 end subroutine profile_setup_cira86
396 subroutine profile_setup_mipas2001
405 character(len=H_LONG) :: fname
407 character(len=7),
parameter :: MIPAS_fname(4) = (/
"equ.atm",
"day.atm",
"sum.atm",
"win.atm"/)
409 integer :: MIPAS_date(6,0:mipas_ntime+1)
412 real(DP) :: subsec = 0.0_dp
413 integer :: offset_year = 0
415 character(len=H_LONG) :: dummy
422 mipas_date(:, 0) = (/ 2000, 12, 22, 12, 0, 0 /)
423 mipas_date(:, 1) = (/ 2001, 6, 21, 12, 0, 0 /)
424 mipas_date(:, 2) = (/ 2001, 12, 22, 12, 0, 0 /)
425 mipas_date(:, 3) = (/ 2002, 6, 21, 12, 0, 0 /)
427 do t = 0, mipas_ntime+1
429 mipas_date(:,t), subsec, &
432 mipas_nd(t) =
real(nday,kind=RP) + nsec / 86400.0_RP
441 do rgn = i_tropic, i_polarwin
442 fname = trim(profile_mipas2001_dir)//
'/'//mipas_fname(rgn)
447 file = trim(fname), &
448 form =
'formatted', &
452 if ( ierr /= 0 )
then 461 call readfile_mipas2001( fid, mipas_z(:,rgn) )
462 call readfile_mipas2001( fid, mipas_pres(:,rgn) )
463 call readfile_mipas2001( fid, mipas_temp(:,rgn) )
465 call readfile_mipas2001( fid, mipas_gas(:,i_n2 ,rgn) )
466 call readfile_mipas2001( fid, mipas_gas(:,i_o2 ,rgn) )
467 call readfile_mipas2001( fid, mipas_gas(:,i_co2 ,rgn) )
468 call readfile_mipas2001( fid, mipas_gas(:,i_o3 ,rgn) )
469 call readfile_mipas2001( fid, mipas_gas(:,i_h2o ,rgn) )
470 call readfile_mipas2001( fid, mipas_gas(:,i_ch4 ,rgn) )
471 call readfile_mipas2001( fid, mipas_gas(:,i_n2o ,rgn) )
472 call readfile_mipas2001( fid, mipas_gas(:,i_hno3 ,rgn) )
473 call readfile_mipas2001( fid, mipas_gas(:,i_co ,rgn) )
474 call readfile_mipas2001( fid, mipas_gas(:,i_no2 ,rgn) )
475 call readfile_mipas2001( fid, mipas_gas(:,i_n2o5 ,rgn) )
476 call readfile_mipas2001( fid, mipas_gas(:,i_clo ,rgn) )
477 call readfile_mipas2001( fid, mipas_gas(:,i_hocl ,rgn) )
478 call readfile_mipas2001( fid, mipas_gas(:,i_clono2,rgn) )
479 call readfile_mipas2001( fid, mipas_gas(:,i_no ,rgn) )
480 call readfile_mipas2001( fid, mipas_gas(:,i_hno4 ,rgn) )
481 call readfile_mipas2001( fid, mipas_gas(:,i_hcn ,rgn) )
482 call readfile_mipas2001( fid, mipas_gas(:,i_nh3 ,rgn) )
483 call readfile_mipas2001( fid, mipas_gas(:,i_f11 ,rgn) )
484 call readfile_mipas2001( fid, mipas_gas(:,i_f12 ,rgn) )
485 call readfile_mipas2001( fid, mipas_gas(:,i_f14 ,rgn) )
486 call readfile_mipas2001( fid, mipas_gas(:,i_f22 ,rgn) )
487 call readfile_mipas2001( fid, mipas_gas(:,i_ccl4 ,rgn) )
488 call readfile_mipas2001( fid, mipas_gas(:,i_cof2 ,rgn) )
489 call readfile_mipas2001( fid, mipas_gas(:,i_h2o2 ,rgn) )
490 call readfile_mipas2001( fid, mipas_gas(:,i_c2h2 ,rgn) )
491 call readfile_mipas2001( fid, mipas_gas(:,i_c2h6 ,rgn) )
492 call readfile_mipas2001( fid, mipas_gas(:,i_ocs ,rgn) )
493 call readfile_mipas2001( fid, mipas_gas(:,i_so2 ,rgn) )
494 call readfile_mipas2001( fid, mipas_gas(:,i_sf6 ,rgn) )
499 end subroutine profile_setup_mipas2001
503 subroutine readfile_mipas2001( &
508 integer,
intent(in) :: fid
509 real(RP),
intent(out) :: var(121)
511 character(len=H_LONG) :: dummy
512 real(RP) :: tmp5(5), tmp1
525 var(nstr-1) = tmp5(2)
526 var(nstr-2) = tmp5(3)
527 var(nstr-3) = tmp5(4)
528 var(nstr-4) = tmp5(5)
537 end subroutine readfile_mipas2001
569 integer,
intent(in) :: kmax
570 integer,
intent(in) :: ngas
571 integer,
intent(in) :: ncfc
572 integer,
intent(in) :: naero
573 real(RP),
intent(in) :: real_lat
574 integer,
intent(in) :: now_date(6)
575 real(RP),
intent(in) :: zh(kmax+1)
576 real(RP),
intent(in) :: z (kmax)
577 real(RP),
intent(out) :: rhodz (kmax)
578 real(RP),
intent(out) :: pres (kmax)
579 real(RP),
intent(out) :: presh (kmax+1)
580 real(RP),
intent(out) :: temp (kmax)
581 real(RP),
intent(out) :: temph (kmax+1)
582 real(RP),
intent(out) :: gas (kmax,ngas)
583 real(RP),
intent(out) :: cfc (kmax,ncfc)
584 real(RP),
intent(out) :: aerosol_conc(kmax,naero)
585 real(RP),
intent(out) :: aerosol_radi(kmax,naero)
586 real(RP),
intent(out) :: cldfrac (kmax)
596 if ( solarins_fixedlatlon )
then 603 if ( solarins_fixeddate )
then 604 if( solarins_date(1) >= 0 ) date(1) = solarins_date(1)
605 if( solarins_date(2) >= 1 ) date(2) = solarins_date(2)
606 if( solarins_date(3) >= 1 ) date(3) = solarins_date(3)
607 if( solarins_date(4) >= 0 ) date(4) = solarins_date(4)
608 if( solarins_date(5) >= 0 ) date(5) = solarins_date(5)
609 if( solarins_date(6) >= 0 ) date(6) = solarins_date(6)
612 call profile_read_climatology( kmax, &
629 call profile_read_user( kmax, &
646 rhodz(k) = ( presh(k+1) - presh(k) ) * 100.0_rp / grav
650 aerosol_conc(:,:) = 0.0_rp
651 aerosol_radi(:,:) = 0.0_rp
654 if ( .NOT. atmos_phy_rd_profile_use_co2 ) gas(:,2) = 0.0_rp
655 if ( .NOT. atmos_phy_rd_profile_use_o3 ) gas(:,3) = 0.0_rp
656 if ( .NOT. atmos_phy_rd_profile_use_n2o ) gas(:,4) = 0.0_rp
657 if ( .NOT. atmos_phy_rd_profile_use_co ) gas(:,5) = 0.0_rp
658 if ( .NOT. atmos_phy_rd_profile_use_ch4 ) gas(:,6) = 0.0_rp
659 if ( .NOT. atmos_phy_rd_profile_use_o2 ) gas(:,7) = 0.0_rp
660 if ( .NOT. atmos_phy_rd_profile_use_cfc ) cfc(:,:) = 0.0_rp
663 if ( debug .AND. report_firsttime )
then 664 report_firsttime = .false.
668 '|=============== Vertical Coordinate =================|' 670 '| -GRID CENTER- -GRID INTERFACE- |' 672 '| k z pres temp zh pres temp k |' 674 '| [km] [hPa] [K] [km] [hPa] [K] |' 677 '| ',zh(k),presh(k),temph(k),k,
' | TOA' 679 '|',k,z(k),pres(k),temp(k),
' | ' 682 '| ',zh(k),presh(k),temph(k),k,
' | ' 684 '|',k,z(k),pres(k),temp(k),
' | ' 688 '| ',zh(k),presh(k),temph(k),k,
' | ' 690 '|',k,z(k),pres(k),temp(k),
' | ' 693 '| ',zh(k),presh(k),temph(k),k,
' | Ground' 695 '|================================================================|' 699 '|=====================================================================================|' 701 '| -Gas concetrations [ppmv]- |' 703 '| k z H2O CO2 O3 N2O CO CH4 O2 |' 705 if(
io_l )
write(
io_fid_log,
'(1x,A,I5,1F9.3,7ES10.3,A)')
'|',k,z(k),gas(k,:),
' | ' 708 '|=====================================================================================|' 717 subroutine profile_read_climatology( &
734 integer,
intent(in) :: kmax
735 integer,
intent(in) :: ngas
736 integer,
intent(in) :: ncfc
737 integer,
intent(in) :: naero
738 real(RP),
intent(in) :: lat
739 integer,
intent(in) :: now_date(6)
740 real(RP),
intent(in) :: zh (kmax+1)
741 real(RP),
intent(in) :: z (kmax)
742 real(RP),
intent(out) :: pres (kmax)
743 real(RP),
intent(out) :: presh(kmax+1)
744 real(RP),
intent(out) :: temp (kmax)
745 real(RP),
intent(out) :: temph(kmax+1)
746 real(RP),
intent(out) :: gas (kmax,ngas)
747 real(RP),
intent(out) :: cfc (kmax,ncfc)
750 if(
io_l )
write(
io_fid_log,*)
'*** [RD_PROFILE] generate climatological profile' 752 call profile_read_cira86( kmax, &
762 call profile_read_mipas2001( kmax, &
775 end subroutine profile_read_climatology
779 subroutine profile_read_cira86( &
793 integer,
intent(in) :: kmax
794 real(RP),
intent(in) :: lat
795 integer,
intent(in) :: now_date(6)
796 real(RP),
intent(in) :: zh (kmax+1)
797 real(RP),
intent(in) :: z (kmax)
798 real(RP),
intent(out) :: presh(kmax+1)
799 real(RP),
intent(out) :: temph(kmax+1)
800 real(RP),
intent(out) :: pres (kmax)
801 real(RP),
intent(out) :: temp (kmax)
803 real(RP) :: plogh(kmax+1)
804 real(RP) :: plog (kmax)
806 integer :: now_date_mod(6), nday
809 real(DP) :: subsec = 0.0_dp
810 integer :: offset_year = 0
813 integer :: indexLAT, indexD
814 real(RP) :: factLAT, factD
820 if ( lat < cira_lat(1) )
then 823 elseif( lat >= cira_lat(cira_nlat) )
then 824 indexlat = cira_nlat - 1
827 do n = 1, cira_nlat-1
828 if ( lat >= cira_lat(n ) &
829 .AND. lat < cira_lat(n+1) )
then 831 factlat = ( lat-cira_lat(n) ) / ( cira_lat(n+1)-cira_lat(n) )
837 now_date_mod(2:6) = now_date(2:6)
838 now_date_mod(1) = 1986
841 now_date_mod(:), subsec, &
844 nd =
real(nday,kind=RP) + nsec / 86400.0_RP
847 if ( nd >= cira_nd(t ) &
848 .AND. nd < cira_nd(t+1) )
then 850 factd = ( nd-cira_nd(t) ) / ( cira_nd(t+1)-cira_nd(t) )
854 interp_z(:) = cira_z(:,indexlat ,indexd ) * ( 1.0_rp-factlat ) * ( 1.0_rp-factd ) &
855 + cira_z(:,indexlat+1,indexd ) * ( factlat ) * ( 1.0_rp-factd ) &
856 + cira_z(:,indexlat ,indexd+1) * ( 1.0_rp-factlat ) * ( factd ) &
857 + cira_z(:,indexlat+1,indexd+1) * ( factlat ) * ( factd )
859 interp_temp(:) = cira_temp(:,indexlat ,indexd ) * ( 1.0_rp-factlat ) * ( 1.0_rp-factd ) &
860 + cira_temp(:,indexlat+1,indexd ) * ( factlat ) * ( 1.0_rp-factd ) &
861 + cira_temp(:,indexlat ,indexd+1) * ( 1.0_rp-factlat ) * ( factd ) &
862 + cira_temp(:,indexlat+1,indexd+1) * ( factlat ) * ( factd )
865 nplev_mod = cira_nplev
866 do n = cira_nplev, 1, -1
867 if ( interp_temp(n) == interp_temp(n-1) )
then 868 nplev_mod = nplev_mod-1
879 call profile_interp( nplev_mod, &
880 interp_z(1:nplev_mod), &
881 cira_plog(1:nplev_mod), &
886 presh(:) = exp( plogh(:) )
888 call profile_interp( kmax+1, zh(:), plogh(:), kmax, z(:), plog(:) )
889 pres(:) = exp( plog(:) )
891 call profile_interp( nplev_mod, &
892 interp_z(1:nplev_mod), &
893 interp_temp(1:nplev_mod), &
898 call profile_interp( nplev_mod, &
899 interp_z(1:nplev_mod), &
900 interp_temp(1:nplev_mod), &
906 end subroutine profile_read_cira86
910 subroutine profile_read_mipas2001( &
923 integer,
intent(in) :: kmax
924 integer,
intent(in) :: ngas
925 integer,
intent(in) :: ncfc
926 real(RP),
intent(in) :: lat
927 integer,
intent(in) :: now_date(6)
928 real(RP),
intent(in) :: z (kmax)
929 real(RP),
intent(inout) :: gas(kmax,ngas)
930 real(RP),
intent(inout) :: cfc(kmax,ncfc)
932 real(RP) :: interp_gas(mipas_kmax,30)
933 real(RP) :: interp_z (mipas_kmax)
935 integer :: now_date_mod(6), nday
938 real(DP) :: subsec = 0.0_dp
939 integer :: offset_year = 0
941 integer :: indexD1, indexD2
942 real(RP) :: factLAT, factD
946 now_date_mod(2:6) = now_date(2:6)
947 now_date_mod(1) = 2001
950 now_date_mod(:), subsec, &
953 nd =
real(nday,kind=RP) + nsec / 86400.0_RP
955 if ( nd >= mipas_nd(0) .AND. nd < mipas_nd(1) )
then 959 factd = ( nd-mipas_nd(0) ) / ( mipas_nd(1)-mipas_nd(0) )
961 elseif( nd >= mipas_nd(1) .AND. nd < mipas_nd(2) )
then 965 factd = ( nd-mipas_nd(1) ) / ( mipas_nd(2)-mipas_nd(1) )
967 elseif( nd >= mipas_nd(2) .AND. nd < mipas_nd(3) )
then 971 factd = ( nd-mipas_nd(2) ) / ( mipas_nd(3)-mipas_nd(2) )
976 if ( lat < mipas_lat(1) )
then 978 interp_gas(:,:) = mipas_gas(:,:,indexd1 ) * ( 1.0_rp-factd ) &
979 + mipas_gas(:,:,indexd2 ) * ( factd )
981 interp_z(:) = mipas_z(:,indexd1 ) * ( 1.0_rp-factd ) &
982 + mipas_z(:,indexd2 ) * ( factd )
984 elseif( lat >= mipas_lat(1) .AND. lat < mipas_lat(2) )
then 986 factlat = ( lat-mipas_lat(1) ) / ( mipas_lat(2)-mipas_lat(1) )
988 interp_gas(:,:) = mipas_gas(:,:,indexd1) * ( 1.0_rp-factd ) * ( 1.0_rp-factlat ) &
989 + mipas_gas(:,:,indexd2) * ( factd ) * ( 1.0_rp-factlat ) &
990 + mipas_gas(:,:,i_midlat) * ( factlat )
992 interp_z(:) = mipas_z(:,indexd1) * ( 1.0_rp-factd ) * ( 1.0_rp-factlat ) &
993 + mipas_z(:,indexd2) * ( factd ) * ( 1.0_rp-factlat ) &
994 + mipas_z(:,i_midlat) * ( factlat )
996 elseif( lat >= mipas_lat(2) .AND. lat < mipas_lat(3) )
then 998 factlat = ( lat-mipas_lat(2) ) / ( mipas_lat(3)-mipas_lat(2) )
1000 interp_gas(:,:) = mipas_gas(:,:,i_midlat) * ( 1.0_rp-factlat ) &
1001 + mipas_gas(:,:,i_tropic) * ( factlat )
1003 interp_z(:) = mipas_z(:,i_midlat) * ( 1.0_rp-factlat ) &
1004 + mipas_z(:,i_tropic) * ( factlat )
1006 elseif( lat >= mipas_lat(3) .AND. lat < mipas_lat(4) )
then 1008 factlat = ( lat-mipas_lat(3) ) / ( mipas_lat(4)-mipas_lat(3) )
1010 interp_gas(:,:) = mipas_gas(:,:,i_tropic) * ( 1.0_rp-factlat ) &
1011 + mipas_gas(:,:,i_midlat) * ( factlat )
1013 interp_z(:) = mipas_z(:,i_tropic) * ( 1.0_rp-factlat ) &
1014 + mipas_z(:,i_midlat) * ( factlat )
1016 elseif( lat >= mipas_lat(4) .AND. lat < mipas_lat(5) )
then 1018 factlat = ( lat-mipas_lat(4) ) / ( mipas_lat(5)-mipas_lat(4) )
1020 interp_gas(:,:) = mipas_gas(:,:,i_midlat) * ( 1.0_rp-factlat ) &
1021 + mipas_gas(:,:,indexd2) * ( 1.0_rp-factd ) * ( factlat ) &
1022 + mipas_gas(:,:,indexd1) * ( factd ) * ( factlat )
1024 interp_z(:) = mipas_z(:,i_midlat) * ( 1.0_rp-factlat ) &
1025 + mipas_z(:,indexd2) * ( 1.0_rp-factd ) * ( factlat ) &
1026 + mipas_z(:,indexd1) * ( factd ) * ( factlat )
1028 elseif( lat >= mipas_lat(5) )
then 1030 interp_gas(:,:) = mipas_gas(:,:,indexd2) * ( 1.0_rp-factd ) &
1031 + mipas_gas(:,:,indexd1) * ( factd )
1033 interp_z(:) = mipas_z(:,indexd2) * ( 1.0_rp-factd ) &
1034 + mipas_z(:,indexd1) * ( factd )
1041 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_h2o ), kmax, z(:), gas(:,1) )
1042 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_co2 ), kmax, z(:), gas(:,2) )
1043 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_o3 ), kmax, z(:), gas(:,3) )
1044 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_n2o ), kmax, z(:), gas(:,4) )
1045 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_co ), kmax, z(:), gas(:,5) )
1046 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_ch4 ), kmax, z(:), gas(:,6) )
1047 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_o2 ), kmax, z(:), gas(:,7) )
1049 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_f11 ), kmax, z(:), cfc(:, 1) )
1050 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_f12 ), kmax, z(:), cfc(:, 2) )
1051 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_f14 ), kmax, z(:), cfc(:, 4) )
1052 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_f22 ), kmax, z(:), cfc(:, 9) )
1053 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_sf6 ), kmax, z(:), cfc(:,22) )
1054 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_clono2), kmax, z(:), cfc(:,23) )
1055 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_ccl4 ), kmax, z(:), cfc(:,24) )
1056 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_n2o5 ), kmax, z(:), cfc(:,25) )
1057 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_hno4 ), kmax, z(:), cfc(:,27) )
1060 end subroutine profile_read_mipas2001
1064 subroutine profile_interp( imax1, x1, y1, imax2, x2, y2 )
1067 integer,
intent(in) :: imax1
1068 real(RP),
intent(in) :: x1(imax1)
1069 real(RP),
intent(in) :: y1(imax1)
1070 integer,
intent(in) :: imax2
1071 real(RP),
intent(in) :: x2(imax2)
1072 real(RP),
intent(out) :: y2(imax2)
1081 if ( x2(i2) > x1(1) )
then 1083 fact = ( x1(1) - x2(i2) ) / ( x1(2) - x1(1) )
1085 y2(i2) = y1(1) * ( 1.0_rp-fact ) &
1088 elseif( x2(i2) <= x1(imax1) )
then 1090 fact = ( x1(imax1) - x2(i2) ) / ( x1(imax1) - x1(imax1-1) )
1092 y2(i2) = y1(imax1-1) * ( fact ) &
1093 + y1(imax1 ) * ( 1.0_rp-fact )
1097 if ( x2(i2) <= x1(i1 ) &
1098 .AND. x2(i2) > x1(i1+1) )
then 1100 fact = ( x2(i2) - x1(i1) ) / ( x1(i1+1) - x1(i1) )
1102 y2(i2) = y1(i1 ) * ( 1.0_rp-fact ) &
1103 + y1(i1+1) * ( fact )
1113 end subroutine profile_interp
1127 integer,
intent(in) :: kmax
1128 integer,
intent(in) :: kadd
1129 real(RP),
intent(inout) :: zh(kmax+1)
1130 real(RP),
intent(inout) :: z (kmax)
1136 if ( kadd > 0 )
then 1138 dz = ( profile_toa - fz(
ke)*1.e-3_rp ) /
real( kadd, kind=
rp )
1142 zh(k) = zh(k-1) - dz
1144 zh(kadd+1) = fz(
ke)*1.e-3_rp
1148 z(k) = 0.5_rp * ( zh(k+1) + zh(k) )
1154 rd_k = kmax - ( k -
ks )
1155 zh(rd_k) = fz(k)*1.e-3_rp
1158 rd_k = kmax - ( k -
ks )
1159 z(rd_k) = cz(k)*1.e-3_rp
1167 '|=============== Vertical Coordinate ===============|' 1169 '| -GRID CENTER- -GRID INTERFACE- |' 1171 '| RD_k z k GRID_CZ GRID_FZ k zh RD_k |' 1172 if ( kadd > 0 )
then 1175 '| ',zh(rd_k),rd_k,
' | TOA' 1177 '|',rd_k,z(rd_k),
' | ' 1180 '| ',zh(rd_k),rd_k,
' | ' 1182 '|',rd_k,z(rd_k),
' | ' 1186 '| ',zh(rd_k),rd_k,
' | ' 1188 '|',rd_k,z(rd_k),
' | KADD' 1190 k = kmax - rd_k +
ks 1192 '| ',fz(k)*1.e-3_rp,k,zh(rd_k),rd_k,
' | ' 1194 '|',rd_k,z(rd_k),k,cz(k)*1.e-3_rp,
' | KADD+1=KE' 1197 k = kmax - rd_k +
ks 1199 '| ',fz(k)*1.e-3_rp,k,zh(rd_k),rd_k,
' | TOA=KE' 1201 '|',rd_k,z(rd_k),k,cz(k)*1.e-3_rp,
' | ' 1203 do rd_k = kadd+2, kmax-1
1204 k = kmax - rd_k +
ks 1206 '| ',fz(k)*1.e-3_rp,k,zh(rd_k),rd_k,
' | ' 1208 '|',rd_k,z(rd_k),k,cz(k)*1.e-3_rp,
' | ' 1211 k = kmax - rd_k +
ks 1213 '| ',fz(k),k,zh(rd_k),rd_k,
' | ' 1215 '|',rd_k,z(rd_k),k,cz(k)*1.e-3_rp,
' | RD_KMAX=KS' 1217 k = kmax - rd_k +
ks 1219 '| ',fz(k)*1.e-3_rp,k,zh(rd_k),rd_k,
' | Ground' 1221 '|=====================================================|' 1230 subroutine profile_read_user( &
1251 integer,
intent(in) ::
kmax 1252 integer,
intent(in) :: ngas
1253 integer,
intent(in) :: ncfc
1254 integer,
intent(in) :: naero
1255 real(RP),
intent(in) :: zh (
kmax+1)
1256 real(RP),
intent(in) :: z (
kmax)
1257 real(RP),
intent(out) :: pres (
kmax)
1258 real(RP),
intent(out) :: presh(
kmax+1)
1259 real(RP),
intent(out) :: temp (
kmax)
1260 real(RP),
intent(out) :: temph(
kmax+1)
1261 real(RP),
intent(out) :: gas (
kmax,ngas)
1262 real(RP),
intent(out) :: cfc (
kmax,ncfc)
1264 integer,
parameter :: USER_klim = 500
1265 integer :: USER_kmax
1266 real(RP) :: USER_z (user_klim)
1267 real(RP) :: USER_pres(user_klim)
1268 real(RP) :: USER_temp(user_klim)
1269 real(RP) :: USER_qv (user_klim)
1270 real(RP) :: USER_o3 (user_klim)
1272 real(RP),
allocatable :: work_z(:)
1273 real(RP),
allocatable :: work (:)
1275 real(RP) :: plog (
kmax)
1276 real(RP) :: plogh(
kmax+1)
1278 character(len=H_LONG) :: dummy
1280 integer :: fid, ierr
1284 if(
io_l )
write(
io_fid_log,*)
'*** [RD_PROFILE] user-defined profile' 1289 if(
io_l )
write(
io_fid_log,*)
'*** FILENAME:', trim(profile_user_fname)
1293 file = trim(profile_user_fname), &
1294 form =
'formatted', &
1298 if ( ierr /= 0 )
then 1306 read(fid,*,iostat=ierr) user_z(k), user_pres(k), user_temp(k), user_qv(k), user_o3(k)
1307 if ( ierr /= 0 )
exit 1312 allocate( work_z(user_kmax) )
1313 allocate( work(user_kmax) )
1316 work_z(k) = user_z(k) / 1000.0_rp
1317 work(k) =
log( user_pres(k)/100.0_rp )
1321 call profile_interp( user_kmax, &
1328 presh(:) = exp( plogh(:) )
1330 call profile_interp(
kmax+1, zh(:), plogh(:),
kmax, z(:), plog(:) )
1331 pres(:) = exp( plog(:) )
1334 work(k) = user_temp(k)
1337 call profile_interp( user_kmax, &
1344 call profile_interp( user_kmax, &
1352 work(k) = user_qv(k) / mvap * mdry / ppm
1355 call profile_interp( user_kmax, &
1363 work(k) = user_o3(k) / 48.0_rp * mdry / ppm
1366 call profile_interp( user_kmax, &
1374 end subroutine profile_read_user
real(rp), parameter, public const_ppm
parts par million
subroutine, public prc_mpistop
Abort MPI.
logical, public io_l
output log or not? (this process)
real(rp), dimension(:), allocatable, public grid_cz
center coordinate [m]: z, local=global
integer, public ke
end point of inner domain: z, local
logical, public atmos_solarins_fixeddate
real(rp), public const_d2r
degree to radian
real(rp), public atmos_solarins_lat
module ATMOSPHERE / Physics Radiation / Vertical profile
logical, public atmos_solarins_fixedlatlon
real(rp), public const_mvap
mass weight (water vapor) [g/mol]
subroutine, public atmos_phy_rd_profile_setup
Setup.
integer function, public io_get_available_fid()
search & get available file ID
integer, public kmax
of computational cells: z
real(rp), dimension(:), allocatable, public grid_fz
face coordinate [m]: z, local=global
subroutine, public atmos_phy_rd_profile_setup_zgrid(kmax, kadd, zh, z)
Setup vertical grid for radiation.
real(rp), public const_grav
standard acceleration of gravity [m/s2]
subroutine, public log(type, message)
integer, public ks
start point of inner domain: z, local
subroutine, public atmos_phy_rd_profile_read(kmax, ngas, ncfc, naero, real_lat, now_date, zh, z, rhodz, pres, presh, temp, temph, gas, cfc, aerosol_conc, aerosol_radi, cldfrac)
Read profile for radiation.
integer, public io_fid_conf
Config file ID.
integer, dimension(6), public atmos_solarins_date
integer, public io_fid_log
Log file ID.
real(rp), public const_mdry
mass weight (dry air) [g/mol]
integer, parameter, public rp
logical, public atmos_phy_rd_profile_use_climatology
use climatology?
subroutine, public calendar_date2daysec(absday, abssec, ymdhms, subsec, offset_year)
Convert from gregorian date to absolute day/second.