18 #include "inc_openmp.h" 49 private :: profile_setup_cira86
50 private :: profile_setup_mipas2001
51 private :: readfile_mipas2001
52 private :: profile_read_climatology
53 private :: profile_read_cira86
54 private :: profile_read_mipas2001
55 private :: profile_read_user
56 private :: profile_interp
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_h2o = .true.
66 logical,
private :: atmos_phy_rd_profile_use_co2 = .true.
67 logical,
private :: atmos_phy_rd_profile_use_o3 = .true.
68 logical,
private :: atmos_phy_rd_profile_use_n2o = .true.
69 logical,
private :: atmos_phy_rd_profile_use_co = .true.
70 logical,
private :: atmos_phy_rd_profile_use_ch4 = .true.
71 logical,
private :: atmos_phy_rd_profile_use_o2 = .true.
72 logical,
private :: atmos_phy_rd_profile_use_cfc = .true.
73 logical,
private :: debug = .false.
75 integer,
private :: cira_ntime
76 integer,
private :: cira_nplev
77 integer,
private :: cira_nlat
78 real(RP),
private,
allocatable :: cira_nd (:)
79 real(RP),
private,
allocatable :: cira_plog(:)
80 real(RP),
private,
allocatable :: cira_lat (:)
81 real(RP),
private,
allocatable :: cira_temp(:,:,:)
82 real(RP),
private,
allocatable :: cira_z (:,:,:)
84 real(RP),
private,
allocatable :: interp_temp(:)
85 real(RP),
private,
allocatable :: interp_z (:)
87 integer,
private,
parameter :: mipas_kmax = 121
88 integer,
private,
parameter :: mipas_ntime = 2
89 real(RP),
private :: mipas_nd (0:mipas_ntime+1)
90 real(RP),
private :: mipas_lat (5)
91 real(RP),
private :: mipas_z (mipas_kmax,4)
92 real(RP),
private :: mipas_pres(mipas_kmax,4)
93 real(RP),
private :: mipas_temp(mipas_kmax,4)
94 real(RP),
private :: mipas_gas (mipas_kmax,30,4)
96 integer,
private,
parameter :: i_tropic = 1
97 integer,
private,
parameter :: i_midlat = 2
98 integer,
private,
parameter :: i_polarsum = 3
99 integer,
private,
parameter :: i_polarwin = 4
101 integer,
private,
parameter :: i_n2 = 1
102 integer,
private,
parameter :: i_o2 = 2
103 integer,
private,
parameter :: i_co2 = 3
104 integer,
private,
parameter :: i_o3 = 4
105 integer,
private,
parameter :: i_h2o = 5
106 integer,
private,
parameter :: i_ch4 = 6
107 integer,
private,
parameter :: i_n2o = 7
108 integer,
private,
parameter :: i_hno3 = 8
109 integer,
private,
parameter :: i_co = 9
110 integer,
private,
parameter :: i_no2 = 10
111 integer,
private,
parameter :: i_n2o5 = 11
112 integer,
private,
parameter :: i_clo = 12
113 integer,
private,
parameter :: i_hocl = 13
114 integer,
private,
parameter :: i_clono2 = 14
115 integer,
private,
parameter :: i_no = 15
116 integer,
private,
parameter :: i_hno4 = 16
117 integer,
private,
parameter :: i_hcn = 17
118 integer,
private,
parameter :: i_nh3 = 18
119 integer,
private,
parameter :: i_f11 = 19
120 integer,
private,
parameter :: i_f12 = 20
121 integer,
private,
parameter :: i_f14 = 21
122 integer,
private,
parameter :: i_f22 = 22
123 integer,
private,
parameter :: i_ccl4 = 23
124 integer,
private,
parameter :: i_cof2 = 24
125 integer,
private,
parameter :: i_h2o2 = 25
126 integer,
private,
parameter :: i_c2h2 = 26
127 integer,
private,
parameter :: i_c2h6 = 27
128 integer,
private,
parameter :: i_ocs = 28
129 integer,
private,
parameter :: i_so2 = 29
130 integer,
private,
parameter :: i_sf6 = 30
132 logical,
private :: report_firsttime = .true.
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 / &
149 atmos_phy_rd_profile_cira86_in_filename, &
150 atmos_phy_rd_profile_mipas2001_in_basename, &
151 atmos_phy_rd_profile_user_in_filename, &
152 atmos_phy_rd_profile_use_h2o, &
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[RADIATION PROFILE] / Categ[ATMOS PHYSICS] / Origin[SCALElib]' 168 atmos_phy_rd_profile_cira86_in_filename = profile_cira86_fname
169 atmos_phy_rd_profile_mipas2001_in_basename = profile_mipas2001_dir
170 atmos_phy_rd_profile_user_in_filename = profile_user_fname
174 read(
io_fid_conf,nml=param_atmos_phy_rd_profile,iostat=ierr)
177 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 178 elseif( ierr > 0 )
then 179 write(*,*)
'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_RD_PROFILE. Check!' 184 profile_cira86_fname = atmos_phy_rd_profile_cira86_in_filename
185 profile_mipas2001_dir = atmos_phy_rd_profile_mipas2001_in_basename
186 profile_user_fname = atmos_phy_rd_profile_user_in_filename
189 if(
io_l )
write(
io_fid_log,*)
'*** Climatological profile for radiation' 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,*)
'*** Read CIRA86 climatology, filename : ', trim(profile_cira86_fname)
232 inquire( file=trim(profile_cira86_fname), exist=exist )
233 if ( .NOT. exist )
then 234 write(*,*)
'*** [PROFILE_setup_CIRA86] File not found. check!' 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
421 if(
io_l )
write(
io_fid_log,*)
'*** Read MIPAS2001 climatology ***' 423 mipas_date(:, 0) = (/ 2000, 12, 22, 12, 0, 0 /)
424 mipas_date(:, 1) = (/ 2001, 6, 21, 12, 0, 0 /)
425 mipas_date(:, 2) = (/ 2001, 12, 22, 12, 0, 0 /)
426 mipas_date(:, 3) = (/ 2002, 6, 21, 12, 0, 0 /)
428 do t = 0, mipas_ntime+1
430 mipas_date(:,t), subsec, &
433 mipas_nd(t) =
real(nday,kind=RP) + nsec / 86400.0_rp
442 do rgn = i_tropic, i_polarwin
443 fname = trim(profile_mipas2001_dir)//
'/'//mipas_fname(rgn)
448 file = trim(fname), &
449 form =
'formatted', &
453 if ( ierr /= 0 )
then 454 write(*,*)
'*** [PROFILE_setup_MIPAS2001] File not found. check!' 462 call readfile_mipas2001( fid, mipas_z(:,rgn) )
463 call readfile_mipas2001( fid, mipas_pres(:,rgn) )
464 call readfile_mipas2001( fid, mipas_temp(:,rgn) )
466 call readfile_mipas2001( fid, mipas_gas(:,i_n2 ,rgn) )
467 call readfile_mipas2001( fid, mipas_gas(:,i_o2 ,rgn) )
468 call readfile_mipas2001( fid, mipas_gas(:,i_co2 ,rgn) )
469 call readfile_mipas2001( fid, mipas_gas(:,i_o3 ,rgn) )
470 call readfile_mipas2001( fid, mipas_gas(:,i_h2o ,rgn) )
471 call readfile_mipas2001( fid, mipas_gas(:,i_ch4 ,rgn) )
472 call readfile_mipas2001( fid, mipas_gas(:,i_n2o ,rgn) )
473 call readfile_mipas2001( fid, mipas_gas(:,i_hno3 ,rgn) )
474 call readfile_mipas2001( fid, mipas_gas(:,i_co ,rgn) )
475 call readfile_mipas2001( fid, mipas_gas(:,i_no2 ,rgn) )
476 call readfile_mipas2001( fid, mipas_gas(:,i_n2o5 ,rgn) )
477 call readfile_mipas2001( fid, mipas_gas(:,i_clo ,rgn) )
478 call readfile_mipas2001( fid, mipas_gas(:,i_hocl ,rgn) )
479 call readfile_mipas2001( fid, mipas_gas(:,i_clono2,rgn) )
480 call readfile_mipas2001( fid, mipas_gas(:,i_no ,rgn) )
481 call readfile_mipas2001( fid, mipas_gas(:,i_hno4 ,rgn) )
482 call readfile_mipas2001( fid, mipas_gas(:,i_hcn ,rgn) )
483 call readfile_mipas2001( fid, mipas_gas(:,i_nh3 ,rgn) )
484 call readfile_mipas2001( fid, mipas_gas(:,i_f11 ,rgn) )
485 call readfile_mipas2001( fid, mipas_gas(:,i_f12 ,rgn) )
486 call readfile_mipas2001( fid, mipas_gas(:,i_f14 ,rgn) )
487 call readfile_mipas2001( fid, mipas_gas(:,i_f22 ,rgn) )
488 call readfile_mipas2001( fid, mipas_gas(:,i_ccl4 ,rgn) )
489 call readfile_mipas2001( fid, mipas_gas(:,i_cof2 ,rgn) )
490 call readfile_mipas2001( fid, mipas_gas(:,i_h2o2 ,rgn) )
491 call readfile_mipas2001( fid, mipas_gas(:,i_c2h2 ,rgn) )
492 call readfile_mipas2001( fid, mipas_gas(:,i_c2h6 ,rgn) )
493 call readfile_mipas2001( fid, mipas_gas(:,i_ocs ,rgn) )
494 call readfile_mipas2001( fid, mipas_gas(:,i_so2 ,rgn) )
495 call readfile_mipas2001( fid, mipas_gas(:,i_sf6 ,rgn) )
500 end subroutine profile_setup_mipas2001
504 subroutine readfile_mipas2001( &
509 integer,
intent(in) :: fid
510 real(RP),
intent(out) :: var(121)
512 character(len=H_LONG) :: dummy
513 real(RP) :: tmp5(5), tmp1
526 var(nstr-1) = tmp5(2)
527 var(nstr-2) = tmp5(3)
528 var(nstr-3) = tmp5(4)
529 var(nstr-4) = tmp5(5)
538 end subroutine readfile_mipas2001
570 integer,
intent(in) ::
kmax 571 integer,
intent(in) :: ngas
572 integer,
intent(in) :: ncfc
573 integer,
intent(in) :: naero
574 real(RP),
intent(in) :: real_lat
575 integer,
intent(in) :: now_date(6)
576 real(RP),
intent(in) :: zh(
kmax+1)
577 real(RP),
intent(in) :: z (
kmax)
578 real(RP),
intent(out) :: rhodz (
kmax)
579 real(RP),
intent(out) :: pres (
kmax)
580 real(RP),
intent(out) :: presh (
kmax+1)
581 real(RP),
intent(out) :: temp (
kmax)
582 real(RP),
intent(out) :: temph (
kmax+1)
583 real(RP),
intent(out) :: gas (
kmax,ngas)
584 real(RP),
intent(out) :: cfc (
kmax,ncfc)
585 real(RP),
intent(out) :: aerosol_conc(
kmax,naero)
586 real(RP),
intent(out) :: aerosol_radi(
kmax,naero)
587 real(RP),
intent(out) :: cldfrac (
kmax)
597 if ( solarins_fixedlatlon )
then 604 if ( solarins_fixeddate )
then 605 if( solarins_date(1) >= 0 ) date(1) = solarins_date(1)
606 if( solarins_date(2) >= 1 ) date(2) = solarins_date(2)
607 if( solarins_date(3) >= 1 ) date(3) = solarins_date(3)
608 if( solarins_date(4) >= 0 ) date(4) = solarins_date(4)
609 if( solarins_date(5) >= 0 ) date(5) = solarins_date(5)
610 if( solarins_date(6) >= 0 ) date(6) = solarins_date(6)
613 call profile_read_climatology(
kmax, &
630 call profile_read_user(
kmax, &
647 rhodz(k) = ( presh(k+1) - presh(k) ) * 100.0_rp / grav
651 aerosol_conc(:,:) = 0.0_rp
652 aerosol_radi(:,:) = 0.0_rp
655 if ( .NOT. atmos_phy_rd_profile_use_h2o ) gas(:,1) = 0.0_rp
656 if ( .NOT. atmos_phy_rd_profile_use_co2 ) gas(:,2) = 0.0_rp
657 if ( .NOT. atmos_phy_rd_profile_use_o3 ) gas(:,3) = 0.0_rp
658 if ( .NOT. atmos_phy_rd_profile_use_n2o ) gas(:,4) = 0.0_rp
659 if ( .NOT. atmos_phy_rd_profile_use_co ) gas(:,5) = 0.0_rp
660 if ( .NOT. atmos_phy_rd_profile_use_ch4 ) gas(:,6) = 0.0_rp
661 if ( .NOT. atmos_phy_rd_profile_use_o2 ) gas(:,7) = 0.0_rp
662 if ( .NOT. atmos_phy_rd_profile_use_cfc ) cfc(:,:) = 0.0_rp
665 if ( debug .AND. report_firsttime )
then 666 report_firsttime = .false.
670 '|=============== Vertical Coordinate =================|' 672 '| -GRID CENTER- -GRID INTERFACE- |' 674 '| k z pres temp zh pres temp k |' 676 '| [km] [hPa] [K] [km] [hPa] [K] |' 679 '| ',zh(k),presh(k),temph(k),k,
' | TOA' 681 '|',k,z(k),pres(k),temp(k),
' | ' 684 '| ',zh(k),presh(k),temph(k),k,
' | ' 686 '|',k,z(k),pres(k),temp(k),
' | ' 690 '| ',zh(k),presh(k),temph(k),k,
' | ' 692 '|',k,z(k),pres(k),temp(k),
' | ' 695 '| ',zh(k),presh(k),temph(k),k,
' | Ground' 697 '|================================================================|' 701 '|=====================================================================================|' 703 '| -Gas concetrations [ppmv]- |' 705 '| k z H2O CO2 O3 N2O CO CH4 O2 |' 707 if(
io_l )
write(
io_fid_log,
'(1x,A,I5,1F9.3,7ES10.3,A)')
'|',k,z(k),gas(k,:),
' | ' 710 '|=====================================================================================|' 719 subroutine profile_read_climatology( &
736 integer,
intent(in) ::
kmax 737 integer,
intent(in) :: ngas
738 integer,
intent(in) :: ncfc
739 integer,
intent(in) :: naero
740 real(RP),
intent(in) :: lat
741 integer,
intent(in) :: now_date(6)
742 real(RP),
intent(in) :: zh (
kmax+1)
743 real(RP),
intent(in) :: z (
kmax)
744 real(RP),
intent(out) :: pres (
kmax)
745 real(RP),
intent(out) :: presh(
kmax+1)
746 real(RP),
intent(out) :: temp (
kmax)
747 real(RP),
intent(out) :: temph(
kmax+1)
748 real(RP),
intent(out) :: gas (
kmax,ngas)
749 real(RP),
intent(out) :: cfc (
kmax,ncfc)
752 if(
io_l )
write(
io_fid_log,*)
'*** Update climatological profile for radiation' 754 call profile_read_cira86(
kmax, &
764 call profile_read_mipas2001(
kmax, &
777 end subroutine profile_read_climatology
781 subroutine profile_read_cira86( &
795 integer,
intent(in) ::
kmax 796 real(RP),
intent(in) :: lat
797 integer,
intent(in) :: now_date(6)
798 real(RP),
intent(in) :: zh (
kmax+1)
799 real(RP),
intent(in) :: z (
kmax)
800 real(RP),
intent(out) :: presh(
kmax+1)
801 real(RP),
intent(out) :: temph(
kmax+1)
802 real(RP),
intent(out) :: pres (
kmax)
803 real(RP),
intent(out) :: temp (
kmax)
805 real(RP) :: plogh(
kmax+1)
806 real(RP) :: plog (
kmax)
808 integer :: now_date_mod(6), nday
811 real(DP) :: subsec = 0.0_dp
812 integer :: offset_year = 0
815 integer :: indexlat, indexd
816 real(RP) :: factlat, factd
822 if ( lat < cira_lat(1) )
then 825 elseif( lat >= cira_lat(cira_nlat) )
then 826 indexlat = cira_nlat - 1
829 do n = 1, cira_nlat-1
830 if ( lat >= cira_lat(n ) &
831 .AND. lat < cira_lat(n+1) )
then 833 factlat = ( lat-cira_lat(n) ) / ( cira_lat(n+1)-cira_lat(n) )
839 now_date_mod(2:6) = now_date(2:6)
840 now_date_mod(1) = 1986
843 now_date_mod(:), subsec, &
846 nd =
real(nday,kind=RP) + nsec / 86400.0_rp
849 if ( nd >= cira_nd(t ) &
850 .AND. nd < cira_nd(t+1) )
then 852 factd = ( nd-cira_nd(t) ) / ( cira_nd(t+1)-cira_nd(t) )
856 interp_z(:) = cira_z(:,indexlat ,indexd ) * ( 1.0_rp-factlat ) * ( 1.0_rp-factd ) &
857 + cira_z(:,indexlat+1,indexd ) * ( factlat ) * ( 1.0_rp-factd ) &
858 + cira_z(:,indexlat ,indexd+1) * ( 1.0_rp-factlat ) * ( factd ) &
859 + cira_z(:,indexlat+1,indexd+1) * ( factlat ) * ( factd )
861 interp_temp(:) = cira_temp(:,indexlat ,indexd ) * ( 1.0_rp-factlat ) * ( 1.0_rp-factd ) &
862 + cira_temp(:,indexlat+1,indexd ) * ( factlat ) * ( 1.0_rp-factd ) &
863 + cira_temp(:,indexlat ,indexd+1) * ( 1.0_rp-factlat ) * ( factd ) &
864 + cira_temp(:,indexlat+1,indexd+1) * ( factlat ) * ( factd )
867 nplev_mod = cira_nplev
868 do n = cira_nplev, 1, -1
869 if ( interp_temp(n) == interp_temp(n-1) )
then 870 nplev_mod = nplev_mod-1
881 call profile_interp( nplev_mod, &
882 interp_z(1:nplev_mod), &
883 cira_plog(1:nplev_mod), &
888 presh(:) = exp( plogh(:) )
890 call profile_interp(
kmax+1, zh(:), plogh(:),
kmax, z(:), plog(:) )
891 pres(:) = exp( plog(:) )
893 call profile_interp( nplev_mod, &
894 interp_z(1:nplev_mod), &
895 interp_temp(1:nplev_mod), &
900 call profile_interp( nplev_mod, &
901 interp_z(1:nplev_mod), &
902 interp_temp(1:nplev_mod), &
908 end subroutine profile_read_cira86
912 subroutine profile_read_mipas2001( &
925 integer,
intent(in) ::
kmax 926 integer,
intent(in) :: ngas
927 integer,
intent(in) :: ncfc
928 real(RP),
intent(in) :: lat
929 integer,
intent(in) :: now_date(6)
930 real(RP),
intent(in) :: z (
kmax)
931 real(RP),
intent(inout) :: gas(
kmax,ngas)
932 real(RP),
intent(inout) :: cfc(
kmax,ncfc)
934 real(RP) :: interp_gas(mipas_kmax,30)
935 real(RP) :: interp_z (mipas_kmax)
937 integer :: now_date_mod(6), nday
940 real(DP) :: subsec = 0.0_dp
941 integer :: offset_year = 0
943 integer :: indexd1, indexd2
944 real(RP) :: factlat, factd
948 now_date_mod(2:6) = now_date(2:6)
949 now_date_mod(1) = 2001
952 now_date_mod(:), subsec, &
955 nd =
real(nday,kind=RP) + nsec / 86400.0_rp
957 if ( nd >= mipas_nd(0) .AND. nd < mipas_nd(1) )
then 961 factd = ( nd-mipas_nd(0) ) / ( mipas_nd(1)-mipas_nd(0) )
963 elseif( nd >= mipas_nd(1) .AND. nd < mipas_nd(2) )
then 967 factd = ( nd-mipas_nd(1) ) / ( mipas_nd(2)-mipas_nd(1) )
969 elseif( nd >= mipas_nd(2) .AND. nd < mipas_nd(3) )
then 973 factd = ( nd-mipas_nd(2) ) / ( mipas_nd(3)-mipas_nd(2) )
978 if ( lat < mipas_lat(1) )
then 980 interp_gas(:,:) = mipas_gas(:,:,indexd1 ) * ( 1.0_rp-factd ) &
981 + mipas_gas(:,:,indexd2 ) * ( factd )
983 interp_z(:) = mipas_z(:,indexd1 ) * ( 1.0_rp-factd ) &
984 + mipas_z(:,indexd2 ) * ( factd )
986 elseif( lat >= mipas_lat(1) .AND. lat < mipas_lat(2) )
then 988 factlat = ( lat-mipas_lat(1) ) / ( mipas_lat(2)-mipas_lat(1) )
990 interp_gas(:,:) = mipas_gas(:,:,indexd1) * ( 1.0_rp-factd ) * ( 1.0_rp-factlat ) &
991 + mipas_gas(:,:,indexd2) * ( factd ) * ( 1.0_rp-factlat ) &
992 + mipas_gas(:,:,i_midlat) * ( factlat )
994 interp_z(:) = mipas_z(:,indexd1) * ( 1.0_rp-factd ) * ( 1.0_rp-factlat ) &
995 + mipas_z(:,indexd2) * ( factd ) * ( 1.0_rp-factlat ) &
996 + mipas_z(:,i_midlat) * ( factlat )
998 elseif( lat >= mipas_lat(2) .AND. lat < mipas_lat(3) )
then 1000 factlat = ( lat-mipas_lat(2) ) / ( mipas_lat(3)-mipas_lat(2) )
1002 interp_gas(:,:) = mipas_gas(:,:,i_midlat) * ( 1.0_rp-factlat ) &
1003 + mipas_gas(:,:,i_tropic) * ( factlat )
1005 interp_z(:) = mipas_z(:,i_midlat) * ( 1.0_rp-factlat ) &
1006 + mipas_z(:,i_tropic) * ( factlat )
1008 elseif( lat >= mipas_lat(3) .AND. lat < mipas_lat(4) )
then 1010 factlat = ( lat-mipas_lat(3) ) / ( mipas_lat(4)-mipas_lat(3) )
1012 interp_gas(:,:) = mipas_gas(:,:,i_tropic) * ( 1.0_rp-factlat ) &
1013 + mipas_gas(:,:,i_midlat) * ( factlat )
1015 interp_z(:) = mipas_z(:,i_tropic) * ( 1.0_rp-factlat ) &
1016 + mipas_z(:,i_midlat) * ( factlat )
1018 elseif( lat >= mipas_lat(4) .AND. lat < mipas_lat(5) )
then 1020 factlat = ( lat-mipas_lat(4) ) / ( mipas_lat(5)-mipas_lat(4) )
1022 interp_gas(:,:) = mipas_gas(:,:,i_midlat) * ( 1.0_rp-factlat ) &
1023 + mipas_gas(:,:,indexd2) * ( 1.0_rp-factd ) * ( factlat ) &
1024 + mipas_gas(:,:,indexd1) * ( factd ) * ( factlat )
1026 interp_z(:) = mipas_z(:,i_midlat) * ( 1.0_rp-factlat ) &
1027 + mipas_z(:,indexd2) * ( 1.0_rp-factd ) * ( factlat ) &
1028 + mipas_z(:,indexd1) * ( factd ) * ( factlat )
1030 elseif( lat >= mipas_lat(5) )
then 1032 interp_gas(:,:) = mipas_gas(:,:,indexd2) * ( 1.0_rp-factd ) &
1033 + mipas_gas(:,:,indexd1) * ( factd )
1035 interp_z(:) = mipas_z(:,indexd2) * ( 1.0_rp-factd ) &
1036 + mipas_z(:,indexd1) * ( factd )
1043 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_h2o ),
kmax, z(:), gas(:,1) )
1044 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_co2 ),
kmax, z(:), gas(:,2) )
1045 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_o3 ),
kmax, z(:), gas(:,3) )
1046 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_n2o ),
kmax, z(:), gas(:,4) )
1047 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_co ),
kmax, z(:), gas(:,5) )
1048 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_ch4 ),
kmax, z(:), gas(:,6) )
1049 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_o2 ),
kmax, z(:), gas(:,7) )
1051 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_f11 ),
kmax, z(:), cfc(:, 1) )
1052 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_f12 ),
kmax, z(:), cfc(:, 2) )
1053 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_f14 ),
kmax, z(:), cfc(:, 4) )
1054 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_f22 ),
kmax, z(:), cfc(:, 9) )
1055 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_sf6 ),
kmax, z(:), cfc(:,22) )
1056 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_clono2),
kmax, z(:), cfc(:,23) )
1057 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_ccl4 ),
kmax, z(:), cfc(:,24) )
1058 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_n2o5 ),
kmax, z(:), cfc(:,25) )
1059 call profile_interp( mipas_kmax, interp_z(:), interp_gas(:,i_hno4 ),
kmax, z(:), cfc(:,27) )
1062 end subroutine profile_read_mipas2001
1066 subroutine profile_interp( imax1, x1, y1, imax2, x2, y2 )
1069 integer,
intent(in) :: imax1
1070 real(RP),
intent(in) :: x1(imax1)
1071 real(RP),
intent(in) :: y1(imax1)
1072 integer,
intent(in) :: imax2
1073 real(RP),
intent(in) :: x2(imax2)
1074 real(RP),
intent(out) :: y2(imax2)
1086 if ( x2(i2) > x1(1) )
then 1088 fact = ( x1(1) - x2(i2) ) / ( x1(2) - x1(1) )
1090 y2(i2) = y1(1) * ( 1.0_rp-fact ) &
1093 elseif( x2(i2) <= x1(imax1) )
then 1095 fact = ( x1(imax1) - x2(i2) ) / ( x1(imax1) - x1(imax1-1) )
1097 y2(i2) = y1(imax1-1) * ( fact ) &
1098 + y1(imax1 ) * ( 1.0_rp-fact )
1102 if ( x2(i2) <= x1(i1 ) &
1103 .AND. x2(i2) > x1(i1+1) )
then 1105 fact = ( x2(i2) - x1(i1) ) / ( x1(i1+1) - x1(i1) )
1107 y2(i2) = y1(i1 ) * ( 1.0_rp-fact ) &
1108 + y1(i1+1) * ( fact )
1118 end subroutine profile_interp
1133 real(RP),
intent(in) :: toa
1134 integer,
intent(in) ::
kmax 1135 integer,
intent(in) :: kadd
1136 real(RP),
intent(inout) :: zh(
kmax+1)
1137 real(RP),
intent(inout) :: z (
kmax)
1143 if ( kadd > 0 )
then 1145 dz = ( toa - fz(
ke)*1.e-3_rp ) /
real( kadd, kind=
rp )
1149 zh(k) = zh(k-1) - dz
1151 zh(kadd+1) = fz(
ke)*1.e-3_rp
1155 z(k) = 0.5_rp * ( zh(k+1) + zh(k) )
1162 zh(rd_k) = fz(k)*1.e-3_rp
1166 z(rd_k) = cz(k)*1.e-3_rp
1174 '|=============== Vertical Coordinate ===============|' 1176 '| -GRID CENTER- -GRID INTERFACE- |' 1178 '| RD_k z k GRID_CZ GRID_FZ k zh RD_k |' 1179 if ( kadd > 0 )
then 1182 '| ',zh(rd_k),rd_k,
' | TOA' 1184 '|',rd_k,z(rd_k),
' | ' 1187 '| ',zh(rd_k),rd_k,
' | ' 1189 '|',rd_k,z(rd_k),
' | ' 1193 '| ',zh(rd_k),rd_k,
' | ' 1195 '|',rd_k,z(rd_k),
' | KADD' 1199 '| ',fz(k)*1.e-3_rp,k,zh(rd_k),rd_k,
' | ' 1201 '|',rd_k,z(rd_k),k,cz(k)*1.e-3_rp,
' | KADD+1=KE' 1206 '| ',fz(k)*1.e-3_rp,k,zh(rd_k),rd_k,
' | TOA=KE' 1208 '|',rd_k,z(rd_k),k,cz(k)*1.e-3_rp,
' | ' 1210 do rd_k = kadd+2,
kmax-1
1213 '| ',fz(k)*1.e-3_rp,k,zh(rd_k),rd_k,
' | ' 1215 '|',rd_k,z(rd_k),k,cz(k)*1.e-3_rp,
' | ' 1220 '| ',fz(k),k,zh(rd_k),rd_k,
' | ' 1222 '|',rd_k,z(rd_k),k,cz(k)*1.e-3_rp,
' | RD_KMAX=KS' 1226 '| ',fz(k)*1.e-3_rp,k,zh(rd_k),rd_k,
' | Ground' 1228 '|=====================================================|' 1237 subroutine profile_read_user( &
1258 integer,
intent(in) ::
kmax 1259 integer,
intent(in) :: ngas
1260 integer,
intent(in) :: ncfc
1261 integer,
intent(in) :: naero
1262 real(RP),
intent(in) :: zh (
kmax+1)
1263 real(RP),
intent(in) :: z (
kmax)
1264 real(RP),
intent(out) :: pres (
kmax)
1265 real(RP),
intent(out) :: presh(
kmax+1)
1266 real(RP),
intent(out) :: temp (
kmax)
1267 real(RP),
intent(out) :: temph(
kmax+1)
1268 real(RP),
intent(out) :: gas (
kmax,ngas)
1269 real(RP),
intent(out) :: cfc (
kmax,ncfc)
1271 integer,
parameter :: user_klim = 500
1272 integer :: user_kmax
1273 real(RP) :: user_z (user_klim)
1274 real(RP) :: user_pres(user_klim)
1275 real(RP) :: user_temp(user_klim)
1276 real(RP) :: user_qv (user_klim)
1277 real(RP) :: user_o3 (user_klim)
1279 real(RP),
allocatable :: work_z(:)
1280 real(RP),
allocatable :: work (:)
1282 real(RP) :: plog (
kmax)
1283 real(RP) :: plogh(
kmax+1)
1285 character(len=H_LONG) :: dummy
1287 integer :: fid, ierr
1291 if(
io_l )
write(
io_fid_log,*)
'*** [RD_PROFILE] user-defined profile' 1296 if(
io_l )
write(
io_fid_log,*)
'*** FILENAME:', trim(profile_user_fname)
1300 file = trim(profile_user_fname), &
1301 form =
'formatted', &
1305 if ( ierr /= 0 )
then 1306 write(*,*)
'*** [PROFILE_read_user] File not found. check!' 1313 read(fid,*,iostat=ierr) user_z(k), user_pres(k), user_temp(k), user_qv(k), user_o3(k)
1314 if ( ierr /= 0 )
exit 1319 allocate( work_z(user_kmax) )
1320 allocate( work(user_kmax) )
1323 work_z(k) = user_z(k) / 1000.0_rp
1324 work(k) = log( user_pres(k)/100.0_rp )
1328 call profile_interp( user_kmax, &
1335 presh(:) = exp( plogh(:) )
1337 call profile_interp(
kmax+1, zh(:), plogh(:),
kmax, z(:), plog(:) )
1338 pres(:) = exp( plog(:) )
1341 work(k) = user_temp(k)
1344 call profile_interp( user_kmax, &
1351 call profile_interp( user_kmax, &
1359 work(k) = user_qv(k) / mvap * mdry / ppm
1362 call profile_interp( user_kmax, &
1370 work(k) = user_o3(k) / 48.0_rp * mdry / ppm
1373 call profile_interp( user_kmax, &
1381 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]
logical, public io_nml
output log or not? (for namelist, this process)
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, local
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.
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.
integer, public io_fid_nml
Log file ID (only for output namelist)