[414] | 1 | c*********************************************************************** |
---|
| 2 | |
---|
| 3 | subroutine NLTEdlvr09_ZGRID (n_gcm, |
---|
| 4 | @ p_gcm, t_gcm, z_gcm, |
---|
| 5 | @ co2vmr_gcm, n2vmr_gcm, covmr_gcm, o3pvmr_gcm ,mmean_gcm, |
---|
| 6 | @ cpnew_gcm) |
---|
| 7 | |
---|
| 8 | c jul 2011 malv+fgg First version |
---|
| 9 | c*********************************************************************** |
---|
| 10 | |
---|
| 11 | implicit none |
---|
| 12 | |
---|
| 13 | include "dimensions.h" |
---|
| 14 | include "dimphys.h" |
---|
| 15 | include 'nltedefs.h' |
---|
| 16 | include 'nlte_atm.h' |
---|
| 17 | include 'tcr_15um.h' |
---|
| 18 | include 'nlte_data.h' |
---|
| 19 | include 'chimiedata.h' |
---|
| 20 | include 'conc.h' |
---|
| 21 | |
---|
| 22 | c Arguments |
---|
| 23 | integer n_gcm |
---|
| 24 | real p_gcm(n_gcm), t_gcm(n_gcm) |
---|
| 25 | real co2vmr_gcm(n_gcm), n2vmr_gcm(n_gcm) |
---|
| 26 | real covmr_gcm(n_gcm), o3pvmr_gcm(n_gcm) |
---|
| 27 | real z_gcm(n_gcm) |
---|
| 28 | real mmean_gcm(n_gcm) |
---|
| 29 | real cpnew_gcm(n_gcm) |
---|
| 30 | |
---|
| 31 | c local variables |
---|
| 32 | integer i, j , iz |
---|
| 33 | ! real distancia, meanm, gz, Hkm |
---|
| 34 | real zmin, zmax, deltazz, deltazzy |
---|
| 35 | real nt_gcm(n_gcm) |
---|
| 36 | real mmean_nlte(n_gcm),cpnew_nlte(n_gcm) |
---|
| 37 | |
---|
| 38 | c functions |
---|
| 39 | external hrkday_convert |
---|
| 40 | real hrkday_convert |
---|
| 41 | |
---|
| 42 | c*********************************************************************** |
---|
| 43 | |
---|
| 44 | |
---|
| 45 | ! Define working grid for MZ1D model (NL, ZL, ZMIN) |
---|
| 46 | ! y otro mas fino para M.Curtis (NZ, ZX, ZXMIN = ZMIN |
---|
| 47 | |
---|
| 48 | ! Para ello hace falta una z de ref del GCM, que voy a suponer la inferior |
---|
| 49 | |
---|
| 50 | ! Primero, construimos escala z_gcm |
---|
| 51 | |
---|
| 52 | ! z_gcm (1) = zmin_gcm ! [km] |
---|
| 53 | |
---|
| 54 | !write (*,*) ' iz, p, g, H, z =', 1, p_gcm(1), z_gcm(1) |
---|
| 55 | ! do iz = 2, n_gcm |
---|
| 56 | ! do iz=1,n_gcm |
---|
| 57 | ! z_gcm(iz)=zlay(iz)/1.e3 |
---|
| 58 | |
---|
| 59 | ! meanm = ( co2vmr_gcm(iz)*44. + o3pvmr_gcm(iz)*16. |
---|
| 60 | ! @ + n2vmr_gcm(iz)*28. + covmr_gcm(iz)*28. ) |
---|
| 61 | ! meanm = meanm / n_avog |
---|
| 62 | ! distancia = ( radio + z_gcm(iz-1) )*1.e5 |
---|
| 63 | ! gz = gg * masa / ( distancia * distancia ) |
---|
| 64 | ! Hkm = 0.5*( t_gcm(iz)+t_gcm(iz-1) ) / ( meanm * gz ) |
---|
| 65 | ! Hkm = kboltzman * Hkm *1e-5 ! [km] |
---|
| 66 | ! z_gcm(iz) = z_gcm(iz-1) - Hkm * log( p_gcm(iz)/p_gcm(iz-1) ) |
---|
| 67 | |
---|
| 68 | !write (*,*) iz, p_gcm(iz), gz, Hkm, z_gcm(iz) |
---|
| 69 | |
---|
| 70 | ! enddo |
---|
| 71 | ! Segundo, definimos los límites del modelo, entre las 2 presiones clave |
---|
| 72 | |
---|
| 73 | ! Bottom boundary for NLTE model : Pbottom=2e-2mb=1.974e-5 atm |
---|
| 74 | jlowerboundary = 1 |
---|
| 75 | do while ( p_gcm(jlowerboundary) .gt. Pbottom_atm ) |
---|
| 76 | jlowerboundary = jlowerboundary + 1 |
---|
| 77 | enddo |
---|
| 78 | zmin = z_gcm(jlowerboundary) |
---|
| 79 | ! write (*,*) ' jlowerboundary, Pmin, zmin =', |
---|
| 80 | ! @ jlowerboundary, p_gcm(jlowerboundary), zmin |
---|
| 81 | |
---|
| 82 | ! Top boundary for NLTE model : Ptop=2e-7mb = 1.974e-5 atm |
---|
| 83 | jtopboundary = jlowerboundary |
---|
| 84 | do while ( p_gcm(jtopboundary) .gt. Ptop_atm ) |
---|
| 85 | jtopboundary = jtopboundary + 1 |
---|
| 86 | enddo |
---|
| 87 | zmax = z_gcm(jtopboundary) |
---|
| 88 | ! write (*,*) ' jtopboundary, Pmax, zmax =', |
---|
| 89 | ! @ jtopboundary, p_gcm(jtopboundary),zmax |
---|
| 90 | |
---|
| 91 | deltaz = (zmax-zmin) / (nl-1) |
---|
| 92 | do i=1,nl |
---|
| 93 | zl(i) = zmin + (i-1) * deltaz |
---|
| 94 | enddo |
---|
| 95 | ! write (*,*) ' ZL grid: dz,zmin,zmax ', deltaz, zl(1),zl(nl) |
---|
| 96 | ! Creamos el perfil interpolando |
---|
| 97 | call intersp ( pl,zl,nl, p_gcm,z_gcm,n_gcm, 2) ! [atm] |
---|
| 98 | call intersp ( t,zl,nl, t_gcm,z_gcm,n_gcm, 1) |
---|
| 99 | do i = 1, n_gcm |
---|
| 100 | nt_gcm(i) = 7.339e+21 * p_gcm(i) / t_gcm(i) ! [cm-3] |
---|
| 101 | enddo |
---|
| 102 | call intersp ( nt,zl,nl, nt_gcm,z_gcm,n_gcm, 2) |
---|
| 103 | call intersp (co2vmr,zl,nl, co2vmr_gcm,z_gcm,n_gcm, 1) |
---|
| 104 | call intersp ( n2vmr,zl,nl, n2vmr_gcm,z_gcm,n_gcm, 1) |
---|
| 105 | call intersp ( covmr,zl,nl, covmr_gcm,z_gcm,n_gcm, 1) |
---|
| 106 | call intersp (o3pvmr,zl,nl, o3pvmr_gcm,z_gcm,n_gcm, 1) |
---|
| 107 | call intersp (mmean_nlte,zl,nl,mmean_gcm,z_gcm,n_gcm,1) |
---|
| 108 | call intersp (cpnew_nlte,zl,nl,cpnew_gcm,z_gcm,n_gcm,1) |
---|
| 109 | |
---|
| 110 | |
---|
| 111 | do i = 1, nl |
---|
| 112 | |
---|
| 113 | co2(i) = nt(i) * co2vmr(i) |
---|
| 114 | n2(i) = nt(i) * n2vmr(i) |
---|
| 115 | co(i) = nt(i) * covmr(i) |
---|
| 116 | o3p(i) = nt(i) * o3pvmr(i) |
---|
| 117 | |
---|
| 118 | ! hrkday_factor(i) = hrkday_convert( t(i), |
---|
| 119 | ! @ co2vmr(i), o3pvmr(i), n2vmr(i), covmr(i) ) |
---|
| 120 | hrkday_factor(i) = hrkday_convert (mmean_nlte(i),cpnew_nlte(i)) |
---|
| 121 | |
---|
| 122 | enddo |
---|
| 123 | |
---|
| 124 | |
---|
| 125 | |
---|
| 126 | c Fine grid for transmittance calculations |
---|
| 127 | |
---|
| 128 | deltazy = (zmax-zmin) / (nzy-1) |
---|
| 129 | do i=1,nzy |
---|
| 130 | zy(i) = zmin + (i-1) * deltazy |
---|
| 131 | enddo |
---|
| 132 | ! write (*,*) ' ZY grid: nzy,dzy,zmin,zmax ', |
---|
| 133 | ! @ nzy, deltazy, zy(1),zy(nzy) |
---|
| 134 | |
---|
| 135 | call intersp ( py,zy,nzy, p_gcm,z_gcm,n_gcm, 2) ! [atm] |
---|
| 136 | call intersp ( ty,zy,nzy, t_gcm,z_gcm,n_gcm, 1) |
---|
| 137 | call intersp ( nty,zy,nzy, nt_gcm,z_gcm,n_gcm, 2) |
---|
| 138 | |
---|
| 139 | call intersp ( co2y,zy,nzy, co2vmr_gcm,z_gcm,n_gcm, 1) |
---|
| 140 | do i=1,nzy |
---|
| 141 | co2y(i) = co2y(i) * nty(i) |
---|
| 142 | enddo |
---|
| 143 | |
---|
| 144 | |
---|
| 145 | |
---|
| 146 | |
---|
| 147 | c end |
---|
| 148 | return |
---|
| 149 | end |
---|