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 character(len=H_LONG),
private :: profile_cira86_fname =
"cira.nc" 62 character(len=H_LONG),
private :: profile_mipas2001_dir =
"." 63 character(len=H_LONG),
private :: profile_user_fname =
"" 64 logical,
private :: atmos_phy_rd_profile_use_co2 = .true.
65 logical,
private :: atmos_phy_rd_profile_use_o3 = .true.
66 logical,
private :: atmos_phy_rd_profile_use_n2o = .true.
67 logical,
private :: atmos_phy_rd_profile_use_co = .true.
68 logical,
private :: atmos_phy_rd_profile_use_ch4 = .true.
69 logical,
private :: atmos_phy_rd_profile_use_o2 = .true.
70 logical,
private :: atmos_phy_rd_profile_use_cfc = .true.
71 logical,
private :: debug = .false.
73 integer,
private :: cira_ntime
74 integer,
private :: cira_nplev
75 integer,
private :: cira_nlat
76 real(RP),
private,
allocatable :: cira_nd (:)
77 real(RP),
private,
allocatable :: cira_plog(:)
78 real(RP),
private,
allocatable :: cira_lat (:)
79 real(RP),
private,
allocatable :: cira_temp(:,:,:)
80 real(RP),
private,
allocatable :: cira_z (:,:,:)
82 real(RP),
private,
allocatable :: interp_temp(:)
83 real(RP),
private,
allocatable :: interp_z (:)
85 integer,
private,
parameter :: mipas_kmax = 121
86 integer,
private,
parameter :: mipas_ntime = 2
87 real(RP),
private :: mipas_nd (0:mipas_ntime+1)
88 real(RP),
private :: mipas_lat (5)
89 real(RP),
private :: mipas_z (mipas_kmax,4)
90 real(RP),
private :: mipas_pres(mipas_kmax,4)
91 real(RP),
private :: mipas_temp(mipas_kmax,4)
92 real(RP),
private :: mipas_gas (mipas_kmax,30,4)
94 integer,
private,
parameter :: i_tropic = 1
95 integer,
private,
parameter :: i_midlat = 2
96 integer,
private,
parameter :: i_polarsum = 3
97 integer,
private,
parameter :: i_polarwin = 4
99 integer,
private,
parameter :: i_n2 = 1
100 integer,
private,
parameter :: i_o2 = 2
101 integer,
private,
parameter :: i_co2 = 3
102 integer,
private,
parameter :: i_o3 = 4
103 integer,
private,
parameter :: i_h2o = 5
104 integer,
private,
parameter :: i_ch4 = 6
105 integer,
private,
parameter :: i_n2o = 7
106 integer,
private,
parameter :: i_hno3 = 8
107 integer,
private,
parameter :: i_co = 9
108 integer,
private,
parameter :: i_no2 = 10
109 integer,
private,
parameter :: i_n2o5 = 11
110 integer,
private,
parameter :: i_clo = 12
111 integer,
private,
parameter :: i_hocl = 13
112 integer,
private,
parameter :: i_clono2 = 14
113 integer,
private,
parameter :: i_no = 15
114 integer,
private,
parameter :: i_hno4 = 16
115 integer,
private,
parameter :: i_hcn = 17
116 integer,
private,
parameter :: i_nh3 = 18
117 integer,
private,
parameter :: i_f11 = 19
118 integer,
private,
parameter :: i_f12 = 20
119 integer,
private,
parameter :: i_f14 = 21
120 integer,
private,
parameter :: i_f22 = 22
121 integer,
private,
parameter :: i_ccl4 = 23
122 integer,
private,
parameter :: i_cof2 = 24
123 integer,
private,
parameter :: i_h2o2 = 25
124 integer,
private,
parameter :: i_c2h2 = 26
125 integer,
private,
parameter :: i_c2h6 = 27
126 integer,
private,
parameter :: i_ocs = 28
127 integer,
private,
parameter :: i_so2 = 29
128 integer,
private,
parameter :: i_sf6 = 30
130 logical,
private :: report_firsttime = .true.
141 character(len=H_LONG) :: ATMOS_PHY_RD_PROFILE_CIRA86_IN_FILENAME
142 character(len=H_LONG) :: ATMOS_PHY_RD_PROFILE_MIPAS2001_IN_BASENAME
143 character(len=H_LONG) :: ATMOS_PHY_RD_PROFILE_USER_IN_FILENAME
145 namelist / param_atmos_phy_rd_profile / &
147 atmos_phy_rd_profile_cira86_in_filename, &
148 atmos_phy_rd_profile_mipas2001_in_basename, &
149 atmos_phy_rd_profile_user_in_filename, &
150 atmos_phy_rd_profile_use_co2, &
151 atmos_phy_rd_profile_use_o3, &
152 atmos_phy_rd_profile_use_n2o, &
153 atmos_phy_rd_profile_use_co, &
154 atmos_phy_rd_profile_use_ch4, &
155 atmos_phy_rd_profile_use_o2, &
156 atmos_phy_rd_profile_use_cfc, &
163 if(
io_l )
write(
io_fid_log,*)
'+++ Module[Physics-RD PROFILE]/Categ[ATMOS]' 166 atmos_phy_rd_profile_cira86_in_filename = profile_cira86_fname
167 atmos_phy_rd_profile_mipas2001_in_basename = profile_mipas2001_dir
168 atmos_phy_rd_profile_user_in_filename = profile_user_fname
172 read(
io_fid_conf,nml=param_atmos_phy_rd_profile,iostat=ierr)
175 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 176 elseif( ierr > 0 )
then 177 write(*,*)
'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_RD_PROFILE. Check!' 182 profile_cira86_fname = atmos_phy_rd_profile_cira86_in_filename
183 profile_mipas2001_dir = atmos_phy_rd_profile_mipas2001_in_basename
184 profile_user_fname = atmos_phy_rd_profile_user_in_filename
188 call profile_setup_cira86
190 call profile_setup_mipas2001
199 subroutine profile_setup_cira86
209 integer :: status, ncid, varid, dimid
211 integer,
allocatable :: CIRA_date(:,:)
214 real(DP) :: subsec = 0.0_dp
215 integer :: offset_year = 0
217 real(4),
allocatable :: tmp1d(:)
218 real(4),
allocatable :: tmp3d(:,:,:)
225 if(
io_l )
write(
io_fid_log,*)
'*** FILENAME:', trim(profile_cira86_fname)
227 inquire( file=trim(profile_cira86_fname), exist=exist )
228 if ( .NOT. exist )
then 234 status = nf90_open( profile_cira86_fname, nf90_nowrite, ncid )
237 status = nf90_inq_dimid( ncid,
"time", dimid )
239 status = nf90_inquire_dimension( ncid, dimid, len=cira_ntime )
242 status = nf90_inq_dimid( ncid,
"plev", dimid )
244 status = nf90_inquire_dimension( ncid, dimid, len=cira_nplev )
247 status = nf90_inq_dimid( ncid,
"latitude", dimid )
249 status = nf90_inquire_dimension( ncid, dimid, len=cira_nlat )
256 allocate( cira_nd( 0:cira_ntime+1) )
258 allocate( cira_plog(cira_nplev) )
259 allocate( cira_lat(cira_nlat ) )
261 allocate( cira_temp(cira_nplev,cira_nlat,0:cira_ntime+1) )
262 allocate( cira_z(cira_nplev,cira_nlat,0:cira_ntime+1) )
265 allocate( cira_date(6,0:cira_ntime+1) )
267 cira_date(:, 0) = (/ 1985, 12, 15, 12, 0, 0 /)
268 cira_date(:, 1) = (/ 1986, 1, 15, 12, 0, 0 /)
269 cira_date(:, 2) = (/ 1986, 2, 15, 12, 0, 0 /)
270 cira_date(:, 3) = (/ 1986, 3, 15, 12, 0, 0 /)
271 cira_date(:, 4) = (/ 1986, 4, 15, 12, 0, 0 /)
272 cira_date(:, 5) = (/ 1986, 5, 15, 12, 0, 0 /)
273 cira_date(:, 6) = (/ 1986, 6, 15, 12, 0, 0 /)
274 cira_date(:, 7) = (/ 1986, 7, 15, 12, 0, 0 /)
275 cira_date(:, 8) = (/ 1986, 8, 15, 12, 0, 0 /)
276 cira_date(:, 9) = (/ 1986, 9, 15, 12, 0, 0 /)
277 cira_date(:,10) = (/ 1986, 10, 15, 12, 0, 0 /)
278 cira_date(:,11) = (/ 1986, 11, 15, 12, 0, 0 /)
279 cira_date(:,12) = (/ 1986, 12, 15, 12, 0, 0 /)
280 cira_date(:,13) = (/ 1987, 1, 15, 12, 0, 0 /)
282 do t = 0, cira_ntime+1
284 cira_date(:,t), subsec, &
287 cira_nd(t) =
real(nday,kind=RP) + nsec / 86400.0_RP
289 deallocate( cira_date )
292 allocate( tmp1d(cira_nplev) )
294 status = nf90_inq_varid( ncid,
"plev", varid )
296 status = nf90_get_var( ncid, varid, tmp1d(:) )
300 cira_plog(n) =
log(
real(tmp1d(n),kind=RP) )
305 allocate( tmp1d(cira_nlat) )
307 status = nf90_inq_varid( ncid,
"latitude", varid )
309 status = nf90_get_var( ncid, varid, tmp1d(:) )
313 cira_lat(n) =
real(tmp1d(n),kind=RP) * CONST_D2R
322 allocate( tmp3d(cira_nlat,cira_nplev,cira_ntime) )
324 status = nf90_inq_varid( ncid,
"ta", varid )
326 status = nf90_get_var( ncid, varid, tmp3d(:,:,:) )
332 cira_temp(n,m,t) =
real(tmp3d(m,n,t),kind=
rp)
337 cira_temp(:,:,0 ) = cira_temp(:,:,cira_ntime)
338 cira_temp(:,:,cira_ntime+1) = cira_temp(:,:,1 )
344 if( cira_temp(n,m,t) >= 999.9_rp ) cira_temp(n,m,t) = cira_temp(n-1,m,t)
352 status = nf90_inq_varid( ncid,
"zg", varid )
354 status = nf90_get_var( ncid, varid, tmp3d(:,:,:) )
360 cira_z(n,m,t) =
real(tmp3d(m,n,t),kind=RP) * 1.E-3_RP
365 cira_z(:,:,0 ) = cira_z(:,:,cira_ntime)
366 cira_z(:,:,cira_ntime+1) = cira_z(:,:,1 )
372 if( cira_z(n,m,t) == 0.999_rp ) cira_z(n,m,t) = cira_z(n-1,m,t)
380 status = nf90_close(ncid)
383 allocate( interp_temp(cira_nplev) )
384 allocate( interp_z(cira_nplev) )
387 end subroutine profile_setup_cira86
391 subroutine profile_setup_mipas2001
400 character(len=H_LONG) :: fname
402 character(len=7),
parameter :: MIPAS_fname(4) = (/
"equ.atm",
"day.atm",
"sum.atm",
"win.atm"/)
404 integer :: MIPAS_date(6,0:mipas_ntime+1)
407 real(DP) :: subsec = 0.0_dp
408 integer :: offset_year = 0
410 character(len=H_LONG) :: dummy
417 mipas_date(:, 0) = (/ 2000, 12, 22, 12, 0, 0 /)
418 mipas_date(:, 1) = (/ 2001, 6, 21, 12, 0, 0 /)
419 mipas_date(:, 2) = (/ 2001, 12, 22, 12, 0, 0 /)
420 mipas_date(:, 3) = (/ 2002, 6, 21, 12, 0, 0 /)
422 do t = 0, mipas_ntime+1
424 mipas_date(:,t), subsec, &
427 mipas_nd(t) =
real(nday,kind=RP) + nsec / 86400.0_RP
436 do rgn = i_tropic, i_polarwin
437 fname = trim(profile_mipas2001_dir)//
'/'//mipas_fname(rgn)
442 file = trim(fname), &
443 form =
'formatted', &
447 if ( ierr /= 0 )
then 456 call readfile_mipas2001( fid, mipas_z(:,rgn) )
457 call readfile_mipas2001( fid, mipas_pres(:,rgn) )
458 call readfile_mipas2001( fid, mipas_temp(:,rgn) )
460 call readfile_mipas2001( fid, mipas_gas(:,i_n2 ,rgn) )
461 call readfile_mipas2001( fid, mipas_gas(:,i_o2 ,rgn) )
462 call readfile_mipas2001( fid, mipas_gas(:,i_co2 ,rgn) )
463 call readfile_mipas2001( fid, mipas_gas(:,i_o3 ,rgn) )
464 call readfile_mipas2001( fid, mipas_gas(:,i_h2o ,rgn) )
465 call readfile_mipas2001( fid, mipas_gas(:,i_ch4 ,rgn) )
466 call readfile_mipas2001( fid, mipas_gas(:,i_n2o ,rgn) )
467 call readfile_mipas2001( fid, mipas_gas(:,i_hno3 ,rgn) )
468 call readfile_mipas2001( fid, mipas_gas(:,i_co ,rgn) )
469 call readfile_mipas2001( fid, mipas_gas(:,i_no2 ,rgn) )
470 call readfile_mipas2001( fid, mipas_gas(:,i_n2o5 ,rgn) )
471 call readfile_mipas2001( fid, mipas_gas(:,i_clo ,rgn) )
472 call readfile_mipas2001( fid, mipas_gas(:,i_hocl ,rgn) )
473 call readfile_mipas2001( fid, mipas_gas(:,i_clono2,rgn) )
474 call readfile_mipas2001( fid, mipas_gas(:,i_no ,rgn) )
475 call readfile_mipas2001( fid, mipas_gas(:,i_hno4 ,rgn) )
476 call readfile_mipas2001( fid, mipas_gas(:,i_hcn ,rgn) )
477 call readfile_mipas2001( fid, mipas_gas(:,i_nh3 ,rgn) )
478 call readfile_mipas2001( fid, mipas_gas(:,i_f11 ,rgn) )
479 call readfile_mipas2001( fid, mipas_gas(:,i_f12 ,rgn) )
480 call readfile_mipas2001( fid, mipas_gas(:,i_f14 ,rgn) )
481 call readfile_mipas2001( fid, mipas_gas(:,i_f22 ,rgn) )
482 call readfile_mipas2001( fid, mipas_gas(:,i_ccl4 ,rgn) )
483 call readfile_mipas2001( fid, mipas_gas(:,i_cof2 ,rgn) )
484 call readfile_mipas2001( fid, mipas_gas(:,i_h2o2 ,rgn) )
485 call readfile_mipas2001( fid, mipas_gas(:,i_c2h2 ,rgn) )
486 call readfile_mipas2001( fid, mipas_gas(:,i_c2h6 ,rgn) )
487 call readfile_mipas2001( fid, mipas_gas(:,i_ocs ,rgn) )
488 call readfile_mipas2001( fid, mipas_gas(:,i_so2 ,rgn) )
489 call readfile_mipas2001( fid, mipas_gas(:,i_sf6 ,rgn) )
494 end subroutine profile_setup_mipas2001
498 subroutine readfile_mipas2001( &
503 integer,
intent(in) :: fid
504 real(RP),
intent(out) :: var(121)
506 character(len=H_LONG) :: dummy
507 real(RP) :: tmp5(5), tmp1
520 var(nstr-1) = tmp5(2)
521 var(nstr-2) = tmp5(3)
522 var(nstr-3) = tmp5(4)
523 var(nstr-4) = tmp5(5)
532 end subroutine readfile_mipas2001
564 integer,
intent(in) :: kmax
565 integer,
intent(in) :: ngas
566 integer,
intent(in) :: ncfc
567 integer,
intent(in) :: naero
568 real(RP),
intent(in) :: real_lat
569 integer,
intent(in) :: now_date(6)
570 real(RP),
intent(in) :: zh(kmax+1)
571 real(RP),
intent(in) :: z (kmax)
572 real(RP),
intent(out) :: rhodz (kmax)
573 real(RP),
intent(out) :: pres (kmax)
574 real(RP),
intent(out) :: presh (kmax+1)
575 real(RP),
intent(out) :: temp (kmax)
576 real(RP),
intent(out) :: temph (kmax+1)
577 real(RP),
intent(out) :: gas (kmax,ngas)
578 real(RP),
intent(out) :: cfc (kmax,ncfc)
579 real(RP),
intent(out) :: aerosol_conc(kmax,naero)
580 real(RP),
intent(out) :: aerosol_radi(kmax,naero)
581 real(RP),
intent(out) :: cldfrac (kmax)
591 if ( solarins_fixedlatlon )
then 598 if ( solarins_fixeddate )
then 599 if( solarins_date(1) >= 0 ) date(1) = solarins_date(1)
600 if( solarins_date(2) >= 1 ) date(2) = solarins_date(2)
601 if( solarins_date(3) >= 1 ) date(3) = solarins_date(3)
602 if( solarins_date(4) >= 0 ) date(4) = solarins_date(4)
603 if( solarins_date(5) >= 0 ) date(5) = solarins_date(5)
604 if( solarins_date(6) >= 0 ) date(6) = solarins_date(6)
607 call profile_read_climatology( kmax, &
624 call profile_read_user( kmax, &
641 rhodz(k) = ( presh(k+1) - presh(k) ) * 100.0_rp / grav
645 aerosol_conc(:,:) = 0.0_rp
646 aerosol_radi(:,:) = 0.0_rp
649 if ( .NOT. atmos_phy_rd_profile_use_co2 ) gas(:,2) = 0.0_rp
650 if ( .NOT. atmos_phy_rd_profile_use_o3 ) gas(:,3) = 0.0_rp
651 if ( .NOT. atmos_phy_rd_profile_use_n2o ) gas(:,4) = 0.0_rp
652 if ( .NOT. atmos_phy_rd_profile_use_co ) gas(:,5) = 0.0_rp
653 if ( .NOT. atmos_phy_rd_profile_use_ch4 ) gas(:,6) = 0.0_rp
654 if ( .NOT. atmos_phy_rd_profile_use_o2 ) gas(:,7) = 0.0_rp
655 if ( .NOT. atmos_phy_rd_profile_use_cfc ) cfc(:,:) = 0.0_rp
658 if ( debug .AND. report_firsttime )
then 659 report_firsttime = .false.
663 '|=============== Vertical Coordinate =================|' 665 '| -GRID CENTER- -GRID INTERFACE- |' 667 '| k z pres temp zh pres temp k |' 669 '| [km] [hPa] [K] [km] [hPa] [K] |' 672 '| ',zh(k),presh(k),temph(k),k,
' | TOA' 674 '|',k,z(k),pres(k),temp(k),
' | ' 677 '| ',zh(k),presh(k),temph(k),k,
' | ' 679 '|',k,z(k),pres(k),temp(k),
' | ' 683 '| ',zh(k),presh(k),temph(k),k,
' | ' 685 '|',k,z(k),pres(k),temp(k),
' | ' 688 '| ',zh(k),presh(k),temph(k),k,
' | Ground' 690 '|================================================================|' 694 '|=====================================================================================|' 696 '| -Gas concetrations [ppmv]- |' 698 '| k z H2O CO2 O3 N2O CO CH4 O2 |' 700 if(
io_l )
write(
io_fid_log,
'(1x,A,I5,1F9.3,7ES10.3,A)')
'|',k,z(k),gas(k,:),
' | ' 703 '|=====================================================================================|' 712 subroutine profile_read_climatology( &
729 integer,
intent(in) :: kmax
730 integer,
intent(in) :: ngas
731 integer,
intent(in) :: ncfc
732 integer,
intent(in) :: naero
733 real(RP),
intent(in) :: lat
734 integer,
intent(in) :: now_date(6)
735 real(RP),
intent(in) :: zh (kmax+1)
736 real(RP),
intent(in) :: z (kmax)
737 real(RP),
intent(out) :: pres (kmax)
738 real(RP),
intent(out) :: presh(kmax+1)
739 real(RP),
intent(out) :: temp (kmax)
740 real(RP),
intent(out) :: temph(kmax+1)
741 real(RP),
intent(out) :: gas (kmax,ngas)
742 real(RP),
intent(out) :: cfc (kmax,ncfc)
745 if(
io_l )
write(
io_fid_log,*)
'*** [RD_PROFILE] generate climatological profile' 747 call profile_read_cira86( kmax, &
757 call profile_read_mipas2001( kmax, &
770 end subroutine profile_read_climatology
774 subroutine profile_read_cira86( &
788 integer,
intent(in) :: kmax
789 real(RP),
intent(in) :: lat
790 integer,
intent(in) :: now_date(6)
791 real(RP),
intent(in) :: zh (kmax+1)
792 real(RP),
intent(in) :: z (kmax)
793 real(RP),
intent(out) :: presh(kmax+1)
794 real(RP),
intent(out) :: temph(kmax+1)
795 real(RP),
intent(out) :: pres (kmax)
796 real(RP),
intent(out) :: temp (kmax)
798 real(RP) :: plogh(kmax+1)
799 real(RP) :: plog (kmax)
801 integer :: now_date_mod(6), nday
804 real(DP) :: subsec = 0.0_dp
805 integer :: offset_year = 0
808 integer :: indexLAT, indexD
809 real(RP) :: factLAT, factD
815 if ( lat < cira_lat(1) )
then 818 elseif( lat >= cira_lat(cira_nlat) )
then 819 indexlat = cira_nlat - 1
822 do n = 1, cira_nlat-1
823 if ( lat >= cira_lat(n ) &
824 .AND. lat < cira_lat(n+1) )
then 826 factlat = ( lat-cira_lat(n) ) / ( cira_lat(n+1)-cira_lat(n) )
832 now_date_mod(2:6) = now_date(2:6)
833 now_date_mod(1) = 1986
836 now_date_mod(:), subsec, &
839 nd =
real(nday,kind=RP) + nsec / 86400.0_RP
842 if ( nd >= cira_nd(t ) &
843 .AND. nd < cira_nd(t+1) )
then 845 factd = ( nd-cira_nd(t) ) / ( cira_nd(t+1)-cira_nd(t) )
849 interp_z(:) = cira_z(:,indexlat ,indexd ) * ( 1.0_rp-factlat ) * ( 1.0_rp-factd ) &
850 + cira_z(:,indexlat+1,indexd ) * ( factlat ) * ( 1.0_rp-factd ) &
851 + cira_z(:,indexlat ,indexd+1) * ( 1.0_rp-factlat ) * ( factd ) &
852 + cira_z(:,indexlat+1,indexd+1) * ( factlat ) * ( factd )
854 interp_temp(:) = cira_temp(:,indexlat ,indexd ) * ( 1.0_rp-factlat ) * ( 1.0_rp-factd ) &
855 + cira_temp(:,indexlat+1,indexd ) * ( factlat ) * ( 1.0_rp-factd ) &
856 + cira_temp(:,indexlat ,indexd+1) * ( 1.0_rp-factlat ) * ( factd ) &
857 + cira_temp(:,indexlat+1,indexd+1) * ( factlat ) * ( factd )
860 nplev_mod = cira_nplev
861 do n = cira_nplev, 1, -1
862 if ( interp_temp(n) == interp_temp(n-1) )
then 863 nplev_mod = nplev_mod-1
874 call profile_interp( nplev_mod, &
875 interp_z(1:nplev_mod), &
876 cira_plog(1:nplev_mod), &
881 presh(:) = exp( plogh(:) )
883 call profile_interp( kmax+1, zh(:), plogh(:), kmax, z(:), plog(:) )
884 pres(:) = exp( plog(:) )
886 call profile_interp( nplev_mod, &
887 interp_z(1:nplev_mod), &
888 interp_temp(1:nplev_mod), &
893 call profile_interp( nplev_mod, &
894 interp_z(1:nplev_mod), &
895 interp_temp(1:nplev_mod), &
901 end subroutine profile_read_cira86
905 subroutine profile_read_mipas2001( &
918 integer,
intent(in) :: kmax
919 integer,
intent(in) :: ngas
920 integer,
intent(in) :: ncfc
921 real(RP),
intent(in) :: lat
922 integer,
intent(in) :: now_date(6)
923 real(RP),
intent(in) :: z (kmax)
924 real(RP),
intent(inout) :: gas(kmax,ngas)
925 real(RP),
intent(inout) :: cfc(kmax,ncfc)
927 real(RP) :: interp_gas(mipas_kmax,30)
928 real(RP) :: interp_z (mipas_kmax)
930 integer :: now_date_mod(6), nday
933 real(DP) :: subsec = 0.0_dp
934 integer :: offset_year = 0
936 integer :: indexD1, indexD2
937 real(RP) :: factLAT, factD
941 now_date_mod(2:6) = now_date(2:6)
942 now_date_mod(1) = 2001
945 now_date_mod(:), subsec, &
948 nd =
real(nday,kind=RP) + nsec / 86400.0_RP
950 if ( nd >= mipas_nd(0) .AND. nd < mipas_nd(1) )
then 954 factd = ( nd-mipas_nd(0) ) / ( mipas_nd(1)-mipas_nd(0) )
956 elseif( nd >= mipas_nd(1) .AND. nd < mipas_nd(2) )
then 960 factd = ( nd-mipas_nd(1) ) / ( mipas_nd(2)-mipas_nd(1) )
962 elseif( nd >= mipas_nd(2) .AND. nd < mipas_nd(3) )
then 966 factd = ( nd-mipas_nd(2) ) / ( mipas_nd(3)-mipas_nd(2) )
971 if ( lat < mipas_lat(1) )
then 973 interp_gas(:,:) = mipas_gas(:,:,indexd1 ) * ( 1.0_rp-factd ) &
974 + mipas_gas(:,:,indexd2 ) * ( factd )
976 interp_z(:) = mipas_z(:,indexd1 ) * ( 1.0_rp-factd ) &
977 + mipas_z(:,indexd2 ) * ( factd )
979 elseif( lat >= mipas_lat(1) .AND. lat < mipas_lat(2) )
then 981 factlat = ( lat-mipas_lat(1) ) / ( mipas_lat(2)-mipas_lat(1) )
983 interp_gas(:,:) = mipas_gas(:,:,indexd1) * ( 1.0_rp-factd ) * ( 1.0_rp-factlat ) &
984 + mipas_gas(:,:,indexd2) * ( factd ) * ( 1.0_rp-factlat ) &
985 + mipas_gas(:,:,i_midlat) * ( factlat )
987 interp_z(:) = mipas_z(:,indexd1) * ( 1.0_rp-factd ) * ( 1.0_rp-factlat ) &
988 + mipas_z(:,indexd2) * ( factd ) * ( 1.0_rp-factlat ) &
989 + mipas_z(:,i_midlat) * ( factlat )
991 elseif( lat >= mipas_lat(2) .AND. lat < mipas_lat(3) )
then 993 factlat = ( lat-mipas_lat(2) ) / ( mipas_lat(3)-mipas_lat(2) )
995 interp_gas(:,:) = mipas_gas(:,:,i_midlat) * ( 1.0_rp-factlat ) &
996 + mipas_gas(:,:,i_tropic) * ( factlat )
998 interp_z(:) = mipas_z(:,i_midlat) * ( 1.0_rp-factlat ) &
999 + mipas_z(:,i_tropic) * ( factlat )
1001 elseif( lat >= mipas_lat(3) .AND. lat < mipas_lat(4) )
then 1003 factlat = ( lat-mipas_lat(3) ) / ( mipas_lat(4)-mipas_lat(3) )
1005 interp_gas(:,:) = mipas_gas(:,:,i_tropic) * ( 1.0_rp-factlat ) &
1006 + mipas_gas(:,:,i_midlat) * ( factlat )
1008 interp_z(:) = mipas_z(:,i_tropic) * ( 1.0_rp-factlat ) &
1009 + mipas_z(:,i_midlat) * ( factlat )
1011 elseif( lat >= mipas_lat(4) .AND. lat < mipas_lat(5) )
then 1013 factlat = ( lat-mipas_lat(4) ) / ( mipas_lat(5)-mipas_lat(4) )
1015 interp_gas(:,:) = mipas_gas(:,:,i_midlat) * ( 1.0_rp-factlat ) &
1016 + mipas_gas(:,:,indexd2) * ( 1.0_rp-factd ) * ( factlat ) &
1017 + mipas_gas(:,:,indexd1) * ( factd ) * ( factlat )
1019 interp_z(:) = mipas_z(:,i_midlat) * ( 1.0_rp-factlat ) &
1020 + mipas_z(:,indexd2) * ( 1.0_rp-factd ) * ( factlat ) &
1021 + mipas_z(:,indexd1) * ( factd ) * ( factlat )
1023 elseif( lat >= mipas_lat(5) )
then 1025 interp_gas(:,:) = mipas_gas(:,:,indexd2) * ( 1.0_rp-factd ) &
1026 + mipas_gas(:,:,indexd1) * ( factd )
1028 interp_z(:) = mipas_z(:,indexd2) * ( 1.0_rp-factd ) &
1029 + mipas_z(:,indexd1) * ( factd )
1036 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_h2o ), kmax, z(:), gas(:,1) )
1037 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_co2 ), kmax, z(:), gas(:,2) )
1038 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_o3 ), kmax, z(:), gas(:,3) )
1039 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_n2o ), kmax, z(:), gas(:,4) )
1040 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_co ), kmax, z(:), gas(:,5) )
1041 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_ch4 ), kmax, z(:), gas(:,6) )
1042 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_o2 ), kmax, z(:), gas(:,7) )
1044 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_f11 ), kmax, z(:), cfc(:, 1) )
1045 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_f12 ), kmax, z(:), cfc(:, 2) )
1046 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_f14 ), kmax, z(:), cfc(:, 4) )
1047 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_f22 ), kmax, z(:), cfc(:, 9) )
1048 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_sf6 ), kmax, z(:), cfc(:,22) )
1049 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_clono2), kmax, z(:), cfc(:,23) )
1050 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_ccl4 ), kmax, z(:), cfc(:,24) )
1051 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_n2o5 ), kmax, z(:), cfc(:,25) )
1052 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_hno4 ), kmax, z(:), cfc(:,27) )
1055 end subroutine profile_read_mipas2001
1059 subroutine profile_interp( imax1, x1, y1, imax2, x2, y2 )
1062 integer,
intent(in) :: imax1
1063 real(RP),
intent(in) :: x1(imax1)
1064 real(RP),
intent(in) :: y1(imax1)
1065 integer,
intent(in) :: imax2
1066 real(RP),
intent(in) :: x2(imax2)
1067 real(RP),
intent(out) :: y2(imax2)
1076 if ( x2(i2) > x1(1) )
then 1078 fact = ( x1(1) - x2(i2) ) / ( x1(2) - x1(1) )
1080 y2(i2) = y1(1) * ( 1.0_rp-fact ) &
1083 elseif( x2(i2) <= x1(imax1) )
then 1085 fact = ( x1(imax1) - x2(i2) ) / ( x1(imax1) - x1(imax1-1) )
1087 y2(i2) = y1(imax1-1) * ( fact ) &
1088 + y1(imax1 ) * ( 1.0_rp-fact )
1092 if ( x2(i2) <= x1(i1 ) &
1093 .AND. x2(i2) > x1(i1+1) )
then 1095 fact = ( x2(i2) - x1(i1) ) / ( x1(i1+1) - x1(i1) )
1097 y2(i2) = y1(i1 ) * ( 1.0_rp-fact ) &
1098 + y1(i1+1) * ( fact )
1108 end subroutine profile_interp
1123 real(RP),
intent(in) :: toa
1124 integer,
intent(in) :: kmax
1125 integer,
intent(in) :: kadd
1126 real(RP),
intent(inout) :: zh(kmax+1)
1127 real(RP),
intent(inout) :: z (kmax)
1133 if ( kadd > 0 )
then 1135 dz = ( toa - fz(
ke)*1.e-3_rp ) /
real( kadd, kind=
rp )
1139 zh(k) = zh(k-1) - dz
1141 zh(kadd+1) = fz(
ke)*1.e-3_rp
1145 z(k) = 0.5_rp * ( zh(k+1) + zh(k) )
1151 rd_k = kmax - ( k -
ks )
1152 zh(rd_k) = fz(k)*1.e-3_rp
1155 rd_k = kmax - ( k -
ks )
1156 z(rd_k) = cz(k)*1.e-3_rp
1164 '|=============== Vertical Coordinate ===============|' 1166 '| -GRID CENTER- -GRID INTERFACE- |' 1168 '| RD_k z k GRID_CZ GRID_FZ k zh RD_k |' 1169 if ( kadd > 0 )
then 1172 '| ',zh(rd_k),rd_k,
' | TOA' 1174 '|',rd_k,z(rd_k),
' | ' 1177 '| ',zh(rd_k),rd_k,
' | ' 1179 '|',rd_k,z(rd_k),
' | ' 1183 '| ',zh(rd_k),rd_k,
' | ' 1185 '|',rd_k,z(rd_k),
' | KADD' 1187 k = kmax - rd_k +
ks 1189 '| ',fz(k)*1.e-3_rp,k,zh(rd_k),rd_k,
' | ' 1191 '|',rd_k,z(rd_k),k,cz(k)*1.e-3_rp,
' | KADD+1=KE' 1194 k = kmax - rd_k +
ks 1196 '| ',fz(k)*1.e-3_rp,k,zh(rd_k),rd_k,
' | TOA=KE' 1198 '|',rd_k,z(rd_k),k,cz(k)*1.e-3_rp,
' | ' 1200 do rd_k = kadd+2, kmax-1
1201 k = kmax - rd_k +
ks 1203 '| ',fz(k)*1.e-3_rp,k,zh(rd_k),rd_k,
' | ' 1205 '|',rd_k,z(rd_k),k,cz(k)*1.e-3_rp,
' | ' 1208 k = kmax - rd_k +
ks 1210 '| ',fz(k),k,zh(rd_k),rd_k,
' | ' 1212 '|',rd_k,z(rd_k),k,cz(k)*1.e-3_rp,
' | RD_KMAX=KS' 1214 k = kmax - rd_k +
ks 1216 '| ',fz(k)*1.e-3_rp,k,zh(rd_k),rd_k,
' | Ground' 1218 '|=====================================================|' 1227 subroutine profile_read_user( &
1248 integer,
intent(in) ::
kmax 1249 integer,
intent(in) :: ngas
1250 integer,
intent(in) :: ncfc
1251 integer,
intent(in) :: naero
1252 real(RP),
intent(in) :: zh (
kmax+1)
1253 real(RP),
intent(in) :: z (
kmax)
1254 real(RP),
intent(out) :: pres (
kmax)
1255 real(RP),
intent(out) :: presh(
kmax+1)
1256 real(RP),
intent(out) :: temp (
kmax)
1257 real(RP),
intent(out) :: temph(
kmax+1)
1258 real(RP),
intent(out) :: gas (
kmax,ngas)
1259 real(RP),
intent(out) :: cfc (
kmax,ncfc)
1261 integer,
parameter :: USER_klim = 500
1262 integer :: USER_kmax
1263 real(RP) :: USER_z (user_klim)
1264 real(RP) :: USER_pres(user_klim)
1265 real(RP) :: USER_temp(user_klim)
1266 real(RP) :: USER_qv (user_klim)
1267 real(RP) :: USER_o3 (user_klim)
1269 real(RP),
allocatable :: work_z(:)
1270 real(RP),
allocatable :: work (:)
1272 real(RP) :: plog (
kmax)
1273 real(RP) :: plogh(
kmax+1)
1275 character(len=H_LONG) :: dummy
1277 integer :: fid, ierr
1281 if(
io_l )
write(
io_fid_log,*)
'*** [RD_PROFILE] user-defined profile' 1286 if(
io_l )
write(
io_fid_log,*)
'*** FILENAME:', trim(profile_user_fname)
1290 file = trim(profile_user_fname), &
1291 form =
'formatted', &
1295 if ( ierr /= 0 )
then 1303 read(fid,*,iostat=ierr) user_z(k), user_pres(k), user_temp(k), user_qv(k), user_o3(k)
1304 if ( ierr /= 0 )
exit 1309 allocate( work_z(user_kmax) )
1310 allocate( work(user_kmax) )
1313 work_z(k) = user_z(k) / 1000.0_rp
1314 work(k) =
log( user_pres(k)/100.0_rp )
1318 call profile_interp( user_kmax, &
1325 presh(:) = exp( plogh(:) )
1327 call profile_interp(
kmax+1, zh(:), plogh(:),
kmax, z(:), plog(:) )
1328 pres(:) = exp( plog(:) )
1331 work(k) = user_temp(k)
1334 call profile_interp( user_kmax, &
1341 call profile_interp( user_kmax, &
1349 work(k) = user_qv(k) / mvap * mdry / ppm
1352 call profile_interp( user_kmax, &
1360 work(k) = user_o3(k) / 48.0_rp * mdry / ppm
1363 call profile_interp( user_kmax, &
1371 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
real(rp), public const_grav
standard acceleration of gravity [m/s2]
subroutine, public atmos_phy_rd_profile_setup_zgrid(toa, kmax, kadd, zh, z)
Setup vertical grid for radiation.
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.