Changeset 1795 for LMDZ5/branches/testing/libf
- Timestamp:
- Jul 18, 2013, 10:20:28 AM (11 years ago)
- Location:
- LMDZ5/branches/testing
- Files:
-
- 15 deleted
- 109 edited
- 12 copied
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/branches/testing
- Property svn:mergeinfo changed
/LMDZ5/trunk merged: 1747-1749,1751,1753-1767,1769,1771-1772,1774-1776,1778-1794
- Property svn:mergeinfo changed
-
LMDZ5/branches/testing/libf/dyn3d/ce0l.F90
r1665 r1795 20 20 USE comgeomphy 21 21 USE infotrac 22 USE indice_sol_mod 22 23 23 24 #ifdef CPP_IOIPSL … … 36 37 #include "dimensions.h" 37 38 #include "paramet.h" 38 #include "indicesol.h"39 !#include "indicesol.h" 39 40 #include "iniprint.h" 40 41 #include "temps.h" -
LMDZ5/branches/testing/libf/dyn3d/comconst.h
r1707 r1795 6 6 7 7 COMMON/comconsti/im,jm,lllm,imp1,jmp1,lllmm1,lllmp1,lcl, & 8 & iflag_top_bound 8 & iflag_top_bound,mode_top_bound 9 9 COMMON/comconstr/dtvr,daysec, & 10 10 & pi,dtphys,dtdiss,rad,r,cpp,kappa,cotot,unsim,g,omeg & … … 30 30 REAL omeg ! (rad/s) rotation rate of the planet 31 31 REAL dissip_factz,dissip_deltaz,dissip_zref 32 INTEGER iflag_top_bound 33 REAL tau_top_bound 32 ! top_bound sponge: 33 INTEGER iflag_top_bound ! sponge type 34 INTEGER mode_top_bound ! sponge mode 35 REAL tau_top_bound ! inverse of sponge characteristic time scale (Hz) 34 36 REAL daylen ! length of solar day, in 'standard' day length 35 37 REAL year_day ! Number of standard days in a year -
LMDZ5/branches/testing/libf/dyn3d/comvert.h
r1669 r1795 23 23 real bps ! hybrid sigma contribution at mid-layers 24 24 real scaleheight ! atmospheric (reference) scale height (km) 25 real pseudoalt ! for planets 25 real pseudoalt ! pseudo-altitude of model levels (km), based on presnivs(), 26 ! preff and scaleheight 26 27 27 28 integer disvert_type ! type of vertical discretization: -
LMDZ5/branches/testing/libf/dyn3d/conf_gcm.F
r1707 r1795 307 307 CALL getin('dissip_zref',dissip_zref ) 308 308 309 ! top_bound sponge: only active if ok_strato=.true. and iflag_top_bound!=0 310 ! iflag_top_bound=0 for no sponge 311 ! iflag_top_bound=1 for sponge over 4 topmost layers 312 ! iflag_top_bound=2 for sponge from top to ~1% of top layer pressure 309 313 iflag_top_bound=1 314 CALL getin('iflag_top_bound',iflag_top_bound) 315 316 ! mode_top_bound : fields towards which sponge relaxation will be done: 317 ! mode_top_bound=0: no relaxation 318 ! mode_top_bound=1: u and v relax towards 0 319 ! mode_top_bound=2: u and v relax towards their zonal mean 320 ! mode_top_bound=3: u,v and pot. temp. relax towards their zonal mean 321 mode_top_bound=3 322 CALL getin('mode_top_bound',mode_top_bound) 323 324 ! top_bound sponge : inverse of charactericstic relaxation time scale for sponge 310 325 tau_top_bound=1.e-5 311 CALL getin('iflag_top_bound',iflag_top_bound)312 326 CALL getin('tau_top_bound',tau_top_bound) 313 327 -
LMDZ5/branches/testing/libf/dyn3d/gcm.F
r1707 r1795 16 16 USE infotrac 17 17 USE control_mod 18 19 #ifdef INCA 20 ! Only INCA needs these informations (from the Earth's physics) 21 USE indice_sol_mod 22 #endif 18 23 19 24 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 77 82 #ifdef INCA 78 83 ! Only INCA needs these informations (from the Earth's physics) 79 #include "indicesol.h"84 !#include "indicesol.h" 80 85 #endif 81 86 INTEGER longcles -
LMDZ5/branches/testing/libf/dyn3d/inigeom.F
r1403 r1795 426 426 radclatm = 0.5* rad * coslatm 427 427 c 428 ai14 = un4rad2 * coslatp * yprp 429 ai23 = un4rad2 * coslatm * yprm 428 430 DO 32 i = 1,iim 429 431 xprp = xprimp025( i ) 430 432 xprm = xprimm025( i ) 431 433 432 ai14 = un4rad2 * coslatp * yprp433 ai23 = un4rad2 * coslatm * yprm434 434 aireij1 ( i,j ) = ai14 * xprp 435 435 aireij2 ( i,j ) = ai23 * xprp -
LMDZ5/branches/testing/libf/dyn3d/leapfrog.F
r1707 r1795 436 436 $ clesphy0, dufi,dvfi,dtetafi,dqfi,dpfi ) 437 437 438 IF (ok_strato) THEN439 CALL top_bound( vcov,ucov,teta,masse,dufi,dvfi,dtetafi)440 ENDIF441 442 438 c ajout des tendances physiques: 443 439 c ------------------------------ … … 445 441 $ ucov, vcov, teta , q ,ps , 446 442 $ dufi, dvfi, dtetafi , dqfi ,dpfi ) 443 444 IF (ok_strato) THEN 445 CALL top_bound( vcov,ucov,teta,masse,dtphys) 446 ENDIF 447 447 448 c 448 449 c Diagnostique de conservation de l'énergie : difference … … 476 477 ! Sponge layer (if any) 477 478 IF (ok_strato) THEN 478 dufi(:,:)=0. 479 dvfi(:,:)=0. 480 dtetafi(:,:)=0. 481 dqfi(:,:,:)=0. 482 dpfi(:)=0. 483 CALL top_bound(vcov,ucov,teta,masse,dufi,dvfi,dtetafi) 484 CALL addfi( dtvr, leapf, forward , 485 $ ucov, vcov, teta , q ,ps , 486 $ dufi, dvfi, dtetafi , dqfi ,dpfi ) 479 ! dufi(:,:)=0. 480 ! dvfi(:,:)=0. 481 ! dtetafi(:,:)=0. 482 ! dqfi(:,:,:)=0. 483 ! dpfi(:)=0. 484 ! CALL top_bound(vcov,ucov,teta,masse,dufi,dvfi,dtetafi) 485 CALL top_bound( vcov,ucov,teta,masse,dtvr) 486 ! CALL addfi( dtvr, leapf, forward , 487 ! $ ucov, vcov, teta , q ,ps , 488 ! $ dufi, dvfi, dtetafi , dqfi ,dpfi ) 487 489 ENDIF ! of IF (ok_strato) 488 490 ENDIF ! of IF (iflag_phys.EQ.2) -
LMDZ5/branches/testing/libf/dyn3d/temps.h
r1665 r1795 13 13 ! INCLUDE 'temps.h' 14 14 15 COMMON/temps/ itaufin, dt, day_ini, day_end, annee_ref, day_ref,&16 & itau_dyn, itau_phy, jD_ref, jH_ref, calend,&17 & start_time15 COMMON/temps/ dt, jD_ref, jH_ref, start_time, & 16 & day_ini, day_end, annee_ref, day_ref, & 17 & itau_dyn, itau_phy, itaufin, calend 18 18 19 19 20 20 INTEGER itaufin 21 INTEGER itau_dyn, itau_phy 21 INTEGER itau_dyn, itau_phy 22 22 INTEGER day_ini, day_end, annee_ref, day_ref 23 23 REAL dt, jD_ref, jH_ref, start_time -
LMDZ5/branches/testing/libf/dyn3d/top_bound.F
r1279 r1795 1 SUBROUTINE top_bound( vcov,ucov,teta,masse, du,dv,dh ) 1 ! 2 ! $Id$ 3 ! 4 SUBROUTINE top_bound(vcov,ucov,teta,masse,dt) 2 5 IMPLICIT NONE 3 6 c … … 24 27 c 25 28 c======================================================================= 26 c-----------------------------------------------------------------------27 c Declarations:28 c -------------29 29 30 ! #include "comgeom.h" 30 ! top_bound sponge layer model: 31 ! Quenching is modeled as: A(t)=Am+A0*exp(-lambda*t) 32 ! where Am is the zonal average of the field (or zero), and lambda the inverse 33 ! of the characteristic quenching/relaxation time scale 34 ! Thus, assuming Am to be time-independent, field at time t+dt is given by: 35 ! A(t+dt)=A(t)-(A(t)-Am)*(1-exp(-lambda*t)) 36 ! Moreover lambda can be a function of model level (see below), and relaxation 37 ! can be toward the average zonal field or just zero (see below). 38 39 ! NB: top_bound sponge is only called from leapfrog if ok_strato=.true. 40 41 ! sponge parameters: (loaded/set in conf_gcm.F ; stored in comconst.h) 42 ! iflag_top_bound=0 for no sponge 43 ! iflag_top_bound=1 for sponge over 4 topmost layers 44 ! iflag_top_bound=2 for sponge from top to ~1% of top layer pressure 45 ! mode_top_bound=0: no relaxation 46 ! mode_top_bound=1: u and v relax towards 0 47 ! mode_top_bound=2: u and v relax towards their zonal mean 48 ! mode_top_bound=3: u,v and pot. temp. relax towards their zonal mean 49 ! tau_top_bound : inverse of charactericstic relaxation time scale at 50 ! the topmost layer (Hz) 51 52 31 53 #include "comdissipn.h" 54 #include "iniprint.h" 32 55 33 56 c Arguments: 34 57 c ---------- 35 58 36 REAL ucov(iip1,jjp1,llm),vcov(iip1,jjm,llm),teta(iip1,jjp1,llm) 37 REAL masse(iip1,jjp1,llm) 38 REAL dv(iip1,jjm,llm),du(iip1,jjp1,llm),dh(iip1,jjp1,llm) 59 real,intent(inout) :: ucov(iip1,jjp1,llm) ! covariant zonal wind 60 real,intent(inout) :: vcov(iip1,jjm,llm) ! covariant meridional wind 61 real,intent(inout) :: teta(iip1,jjp1,llm) ! potential temperature 62 real,intent(in) :: masse(iip1,jjp1,llm) ! mass of atmosphere 63 real,intent(in) :: dt ! time step (s) of sponge model 39 64 40 65 c Local: … … 44 69 REAL uzon(jjp1,llm),vzon(jjm,llm),tzon(jjp1,llm) 45 70 46 INTEGER NDAMP47 PARAMETER (NDAMP=4)48 71 integer i 49 REAL,SAVE :: rdamp(llm) 50 ! & (/(0., i =1,llm-NDAMP),0.125E-5,.25E-5,.5E-5,1.E-5/) 72 REAL,SAVE :: rdamp(llm) ! quenching coefficient 73 real,save :: lambda(llm) ! inverse or quenching time scale (Hz) 51 74 52 75 LOGICAL,SAVE :: first=.true. 53 76 54 77 INTEGER j,l 55 56 57 C CALCUL DES CHAMPS EN MOYENNE ZONALE:58 78 59 79 if (iflag_top_bound.eq.0) return … … 61 81 if (first) then 62 82 if (iflag_top_bound.eq.1) then 63 ! couche eponge dans les 4 dernieres couches du modele64 rdamp(:)=0.65 rdamp(llm)=tau_top_bound66 rdamp(llm-1)=tau_top_bound/2.67 rdamp(llm-2)=tau_top_bound/4.68 rdamp(llm-3)=tau_top_bound/8.83 ! sponge quenching over the topmost 4 atmospheric layers 84 lambda(:)=0. 85 lambda(llm)=tau_top_bound 86 lambda(llm-1)=tau_top_bound/2. 87 lambda(llm-2)=tau_top_bound/4. 88 lambda(llm-3)=tau_top_bound/8. 69 89 else if (iflag_top_bound.eq.2) then 70 ! couce eponge dans toutes les couches de pression plus faible que71 ! 100 fois la pression de la derniere couche72 rdamp(:)=tau_top_bound90 ! sponge quenching over topmost layers down to pressures which are 91 ! higher than 100 times the topmost layer pressure 92 lambda(:)=tau_top_bound 73 93 s *max(presnivs(llm)/presnivs(:)-0.01,0.) 74 94 endif 95 96 ! quenching coefficient rdamp(:) 97 ! rdamp(:)=dt*lambda(:) ! Explicit Euler approx. 98 rdamp(:)=1.-exp(-lambda(:)*dt) 99 100 write(lunout,*)'TOP_BOUND mode',mode_top_bound 101 write(lunout,*)'Sponge layer coefficients' 102 write(lunout,*)'p (Pa) z(km) tau(s) 1./tau (Hz)' 103 do l=1,llm 104 if (rdamp(l).ne.0.) then 105 write(lunout,'(6(1pe12.4,1x))') 106 & presnivs(l),log(preff/presnivs(l))*scaleheight, 107 & 1./lambda(l),lambda(l) 108 endif 109 enddo 75 110 first=.false. 76 print*,'TOP_BOUND rdamp=',rdamp 77 endif 111 endif ! of if (first) 78 112 79 113 CALL massbar(masse,massebx,masseby) 80 114 81 do l=1,llm 115 ! compute zonal average of vcov and u 116 if (mode_top_bound.ge.2) then 117 do l=1,llm 82 118 do j=1,jjm 83 119 vzon(j,l)=0. 84 120 zm=0. 85 121 do i=1,iim 86 ! Rm: on peut travailler directement avec la moyenne zonale de vcov 87 ! plutot qu'avec celle de v car le coefficient cv qui relie les deux 88 ! ne varie qu'en latitude 122 ! NB: we can work using vcov zonal mean rather than v since the 123 ! cv coefficient (which relates the two) only varies with latitudes 89 124 vzon(j,l)=vzon(j,l)+vcov(i,j,l)*masseby(i,j,l) 90 125 zm=zm+masseby(i,j,l) … … 92 127 vzon(j,l)=vzon(j,l)/zm 93 128 enddo 94 enddo129 enddo 95 130 96 do l=1,llm 97 do i=1,iip1 98 do j=1,jjm 99 dv(i,j,l)=dv(i,j,l)-rdamp(l)*(vcov(i,j,l)-vzon(j,l)) 100 enddo 101 enddo 102 enddo 103 104 do l=1,llm 105 do j=2,jjm 131 do l=1,llm 132 do j=2,jjm ! excluding poles 106 133 uzon(j,l)=0. 107 134 zm=0. … … 112 139 uzon(j,l)=uzon(j,l)/zm 113 140 enddo 114 enddo 141 enddo 142 else ! ucov and vcov will relax towards 0 143 vzon(:,:)=0. 144 uzon(:,:)=0. 145 endif ! of if (mode_top_bound.ge.2) 115 146 116 do l=1,llm 117 do j=2,jjm 147 ! compute zonal average of potential temperature, if necessary 148 if (mode_top_bound.ge.3) then 149 do l=1,llm 150 do j=2,jjm ! excluding poles 118 151 zm=0. 119 152 tzon(j,l)=0. … … 124 157 tzon(j,l)=tzon(j,l)/zm 125 158 enddo 126 enddo 159 enddo 160 endif ! of if (mode_top_bound.ge.3) 127 161 128 C AMORTISSEMENTS LINEAIRES: 129 130 do l=1,llm162 if (mode_top_bound.ge.1) then 163 ! Apply sponge quenching on vcov: 164 do l=1,llm 131 165 do i=1,iip1 132 do j=2,jjm 133 du(i,j,l)=du(i,j,l) 134 s -rdamp(l)*(ucov(i,j,l)-cu(i,j)*uzon(j,l)) 135 dh(i,j,l)=dh(i,j,l)-rdamp(l)*(teta(i,j,l)-tzon(j,l)) 166 do j=1,jjm 167 vcov(i,j,l)=vcov(i,j,l) 168 & -rdamp(l)*(vcov(i,j,l)-vzon(j,l)) 136 169 enddo 137 170 enddo 138 enddo 139 171 enddo 140 172 141 RETURN 173 ! Apply sponge quenching on ucov: 174 do l=1,llm 175 do i=1,iip1 176 do j=2,jjm ! excluding poles 177 ucov(i,j,l)=ucov(i,j,l) 178 & -rdamp(l)*(ucov(i,j,l)-cu(i,j)*uzon(j,l)) 179 enddo 180 enddo 181 enddo 182 endif ! of if (mode_top_bound.ge.1) 183 184 if (mode_top_bound.ge.3) then 185 ! Apply sponge quenching on teta: 186 do l=1,llm 187 do i=1,iip1 188 do j=2,jjm ! excluding poles 189 teta(i,j,l)=teta(i,j,l) 190 & -rdamp(l)*(teta(i,j,l)-tzon(j,l)) 191 enddo 192 enddo 193 enddo 194 endif ! of if (mode_top_bound.ge.3) 195 142 196 END -
LMDZ5/branches/testing/libf/dyn3dmem/abort_gcm.F
r1707 r1795 1 1 ! 2 ! $Id $2 ! $Id: abort_gcm.F 1747 2013-04-23 14:06:30Z lguez $ 3 3 ! 4 4 c … … 24 24 25 25 character(len=*) modname 26 integer ierr 26 integer ierr, ierror_mpi 27 27 character(len=*) message 28 28 … … 47 47 else 48 48 write(lunout,*) 'Houston, we have a problem ', ierr 49 #ifdef CPP_MPI 50 C$OMP CRITICAL (MPI_ABORT_GCM) 51 call MPI_ABORT(COMM_LMDZ, 1, ierror_mpi) 52 C$OMP END CRITICAL (MPI_ABORT_GCM) 53 #else 49 54 stop 1 55 #endif 50 56 endif 51 57 END -
LMDZ5/branches/testing/libf/dyn3dmem/calfis_loc.F
r1707 r1795 34 34 USE dimphy 35 35 USE mod_phys_lmdz_para, mpi_root_xx=>mpi_root 36 USE parallel, ONLY : omp_chunk, using_mpi,jjb_u,jje_u,jjb_v,jje_v37 36 USE mod_interface_dyn_phys 38 37 USE IOPHY 39 38 #endif 39 USE parallel, ONLY : omp_chunk, using_mpi,jjb_u,jje_u,jjb_v,jje_v 40 40 USE Write_Field 41 41 Use Write_field_p … … 116 116 c ----------- 117 117 LOGICAL lafin 118 REAL heure119 118 ! REAL heure 119 REAL, intent(in):: jD_cur, jH_cur 120 120 REAL pvcov(iip1,jjb_v:jje_v,llm) 121 121 REAL pucov(iip1,jjb_u:jje_u,llm) … … 130 130 REAL pdteta(iip1,jjb_u:jje_u,llm) 131 131 REAL pdq(iip1,jjb_u:jje_u,llm,nqtot) 132 REAL flxw(iip1,jjb_u:jje_u,llm) ! Flux de masse verticale sur la grille dynamique 132 133 c 133 134 REAL pps(iip1,jjb_u:jje_u) … … 226 227 REAL PVteta(klon,ntetaSTD) 227 228 228 REAL flxw(iip1,jjb_u:jje_u,llm) ! Flux de masse verticale sur la grille dynamique229 229 230 230 REAL SSUM … … 234 234 SAVE firstcal,debut 235 235 c$OMP THREADPRIVATE(firstcal,debut) 236 REAL, intent(in):: jD_cur, jH_cur237 236 238 237 REAL,SAVE,dimension(1:iim,1:llm):: du_send,du_recv,dv_send,dv_recv -
LMDZ5/branches/testing/libf/dyn3dmem/call_calfis_mod.F90
r1707 r1795 321 321 #endif 322 322 323 IF (ok_strato) THEN324 CALL top_bound_loc( vcov,ucov,teta,masse,dufi,dvfi,dtetafi)325 ENDIF326 327 323 #ifdef DEBUG_IO 328 324 CALL WriteField_u('ucovfi',ucov) … … 348 344 ENDDO 349 345 #endif 346 347 IF (ok_strato) THEN 348 ! CALL top_bound_loc( vcov,ucov,teta,masse,dufi,dvfi,dtetafi) 349 CALL top_bound_loc(vcov,ucov,teta,masse,dtphys) 350 ENDIF 350 351 351 352 !$OMP BARRIER -
LMDZ5/branches/testing/libf/dyn3dmem/ce0l.F90
r1707 r1795 23 23 USE infotrac 24 24 USE parallel, ONLY: finalize_parallel 25 USE indice_sol_mod 25 26 26 27 #ifdef CPP_IOIPSL … … 39 40 #include "dimensions.h" 40 41 #include "paramet.h" 41 #include "indicesol.h"42 !#include "indicesol.h" 42 43 #include "iniprint.h" 43 44 #include "temps.h" -
LMDZ5/branches/testing/libf/dyn3dmem/comconst.h
r1707 r1795 1 1 ! 2 ! $Id $2 ! $Id: comconst.h 1671 2012-10-24 07:10:10Z emillour $ 3 3 ! 4 4 !----------------------------------------------------------------------- … … 6 6 7 7 COMMON/comconsti/im,jm,lllm,imp1,jmp1,lllmm1,lllmp1,lcl, & 8 & iflag_top_bound 8 & iflag_top_bound,mode_top_bound 9 9 COMMON/comconstr/dtvr,daysec, & 10 10 & pi,dtphys,dtdiss,rad,r,cpp,kappa,cotot,unsim,g,omeg & … … 21 21 REAL dtdiss ! (s) time step for the dissipation 22 22 REAL rad ! (m) radius of the planet 23 REAL r ! Reduced Gas constant r=R/mu 24 ! with R=8.31.. J.K-1.mol-1, mu: mol mass of atmosphere (kg/mol) 23 REAL r ! Reduced Gas constant r=R/mu 24 ! with R=8.31.. J.K-1.mol-1, mu: mol mass of atmosphere (kg/mol) 25 25 REAL cpp ! Specific heat Cp (J.kg-1.K-1) 26 26 REAL kappa ! kappa=R/Cp … … 30 30 REAL omeg ! (rad/s) rotation rate of the planet 31 31 REAL dissip_factz,dissip_deltaz,dissip_zref 32 INTEGER iflag_top_bound 33 REAL tau_top_bound 32 ! top_bound sponge: 33 INTEGER iflag_top_bound ! sponge type 34 INTEGER mode_top_bound ! sponge mode 35 REAL tau_top_bound ! inverse of sponge characteristic time scale (Hz) 34 36 REAL daylen ! length of solar day, in 'standard' day length 35 37 REAL year_day ! Number of standard days in a year -
LMDZ5/branches/testing/libf/dyn3dmem/comvert.h
r1707 r1795 1 1 ! 2 ! $Id $2 ! $Id: comvert.h 1654 2012-09-24 15:07:18Z aslmd $ 3 3 ! 4 4 !----------------------------------------------------------------------- … … 23 23 real bps ! hybrid sigma contribution at mid-layers 24 24 real scaleheight ! atmospheric (reference) scale height (km) 25 real pseudoalt ! for planets 25 real pseudoalt ! pseudo-altitude of model levels (km), based on presnivs(), 26 ! preff and scaleheight 26 27 27 28 integer disvert_type ! type of vertical discretization: -
LMDZ5/branches/testing/libf/dyn3dmem/conf_gcm.F
r1750 r1795 335 335 CALL getin('dissip_zref',dissip_zref ) 336 336 337 ! top_bound sponge: only active if ok_strato=.true. and iflag_top_bound!=0 338 ! iflag_top_bound=0 for no sponge 339 ! iflag_top_bound=1 for sponge over 4 topmost layers 340 ! iflag_top_bound=2 for sponge from top to ~1% of top layer pressure 337 341 iflag_top_bound=1 342 CALL getin('iflag_top_bound',iflag_top_bound) 343 344 ! mode_top_bound : fields towards which sponge relaxation will be done: 345 ! mode_top_bound=0: no relaxation 346 ! mode_top_bound=1: u and v relax towards 0 347 ! mode_top_bound=2: u and v relax towards their zonal mean 348 ! mode_top_bound=3: u,v and pot. temp. relax towards their zonal mean 349 mode_top_bound=3 350 CALL getin('mode_top_bound',mode_top_bound) 351 352 ! top_bound sponge : inverse of charactericstic relaxation time scale for sponge 338 353 tau_top_bound=1.e-5 339 CALL getin('iflag_top_bound',iflag_top_bound)340 354 CALL getin('tau_top_bound',tau_top_bound) 341 355 -
LMDZ5/branches/testing/libf/dyn3dmem/exner_milieu_loc.F
r1707 r1795 27 27 c 28 28 USE parallel 29 USE mod_filtreg_p 29 30 IMPLICIT NONE 30 31 c … … 120 121 jjb=jj_begin 121 122 jje=jj_end 122 CALL filtreg_p ( pkf,jjb,jje, jmp1, llm, 2, 1, .TRUE., 1 ) 123 CALL filtreg_p ( pkf,jjb_u,jje_u,jjb,jje, jmp1, llm, 124 & 2, 1, .TRUE., 1 ) 123 125 124 126 ! our work is done, exit routine … … 206 208 jjb=jj_begin 207 209 jje=jj_end 208 CALL filtreg_p ( pkf,jjb,jje, jmp1, llm, 2, 1, .TRUE., 1 ) 210 CALL filtreg_p ( pkf,jjb_u,jje_u,jjb,jje, jmp1, llm, 211 & 2, 1, .TRUE., 1 ) 209 212 210 213 c EST-CE UTILE ?? : calcul de beta -
LMDZ5/branches/testing/libf/dyn3dmem/gcm.F
r1707 r1795 19 19 USE filtreg_mod 20 20 USE control_mod 21 22 #ifdef INCA 23 ! Only INCA needs these informations (from the Earth's physics) 24 USE indice_sol_mod 25 #endif 21 26 22 27 #ifdef CPP_PHYS … … 75 80 #ifdef INCA 76 81 ! Only INCA needs these informations (from the Earth's physics) 77 #include "indicesol.h"82 !#include "indicesol.h" 78 83 #endif 79 84 … … 270 275 ! constants & fields, if we run the 'newtonian' or 'SW' cases: 271 276 if (iflag_phys.ne.1) then 272 CALL iniacademic (vcov,ucov,teta,q,masse,ps,phis,time_0)277 CALL iniacademic_loc(vcov,ucov,teta,q,masse,ps,phis,time_0) 273 278 endif 274 279 … … 291 296 . 'GCM: AVANT iniacademic AVANT AVANT AVANT AVANT' 292 297 if (.not.read_start) then 293 CALL iniacademic (vcov,ucov,teta,q,masse,ps,phis,time_0)298 CALL iniacademic_loc(vcov,ucov,teta,q,masse,ps,phis,time_0) 294 299 endif 295 300 … … 398 403 #endif 399 404 400 405 if (iflag_phys.eq.1) then 406 ! these initialisations have already been done (via iniacademic) 407 ! if running in SW or Newtonian mode 401 408 c----------------------------------------------------------------------- 402 409 c Initialisation des constantes dynamiques : … … 414 421 c -------------------------- 415 422 CALL inifilr 423 endif ! of if (iflag_phys.eq.1) 416 424 c 417 425 c----------------------------------------------------------------------- -
LMDZ5/branches/testing/libf/dyn3dmem/inigeom.F
r1669 r1795 426 426 radclatm = 0.5* rad * coslatm 427 427 c 428 ai14 = un4rad2 * coslatp * yprp 429 ai23 = un4rad2 * coslatm * yprm 428 430 DO 32 i = 1,iim 429 431 xprp = xprimp025( i ) 430 432 xprm = xprimm025( i ) 431 433 432 ai14 = un4rad2 * coslatp * yprp433 ai23 = un4rad2 * coslatm * yprm434 434 aireij1 ( i,j ) = ai14 * xprp 435 435 aireij2 ( i,j ) = ai23 * xprp -
LMDZ5/branches/testing/libf/dyn3dmem/leapfrog_loc.F
r1707 r1795 1125 1125 ! Sponge layer (if any) 1126 1126 IF (ok_strato) THEN 1127 ! set dufi,dvfi,... to zero 1128 ijb=ij_begin 1129 ije=ij_end 1130 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 1131 do l=1,llm 1132 dufi(ijb:ije,l)=0 1133 dtetafi(ijb:ije,l)=0 1134 dqfi(ijb:ije,l,1:nqtot)=0 1135 enddo 1136 !$OMP END DO 1137 !$OMP MASTER 1138 dpfi(ijb:ije)=0 1139 !$OMP END MASTER 1140 ijb=ij_begin 1141 ije=ij_end 1142 if (pole_sud) ije=ije-iip1 1143 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 1144 do l=1,llm 1145 dvfi(ijb:ije,l)=0 1146 enddo 1147 !$OMP END DO 1148 1149 CALL top_bound_loc(vcov,ucov,teta,masse,dufi,dvfi,dtetafi) 1150 CALL addfi_loc( dtvr, leapf, forward , 1151 $ ucov, vcov, teta , q ,ps , 1152 $ dufi, dvfi, dtetafi , dqfi ,dpfi ) 1127 CALL top_bound_loc(vcov,ucov,teta,masse,dtvr) 1153 1128 !$OMP BARRIER 1154 1129 ENDIF ! of IF (ok_strato) -
LMDZ5/branches/testing/libf/dyn3dmem/temps.h
r1707 r1795 13 13 ! INCLUDE 'temps.h' 14 14 15 COMMON/temps/ itaufin, dt, day_ini, day_end, annee_ref, day_ref,&16 & itau_dyn, itau_phy, jD_ref, jH_ref, calend,&17 & start_time15 COMMON/temps/ dt, jD_ref, jH_ref, start_time, & 16 & day_ini, day_end, annee_ref, day_ref, & 17 & itau_dyn, itau_phy, itaufin, calend 18 18 19 19 20 20 INTEGER itaufin 21 INTEGER itau_dyn, itau_phy 21 INTEGER itau_dyn, itau_phy 22 22 INTEGER day_ini, day_end, annee_ref, day_ref 23 23 REAL dt, jD_ref, jH_ref, start_time -
LMDZ5/branches/testing/libf/dyn3dmem/top_bound_loc.F
r1669 r1795 1 SUBROUTINE top_bound_loc( vcov,ucov,teta,masse, du,dv,dh ) 1 ! 2 ! $Id: $ 3 ! 4 SUBROUTINE top_bound_loc(vcov,ucov,teta,masse,dt) 2 5 USE parallel 3 6 IMPLICIT NONE … … 25 28 c 26 29 c======================================================================= 27 c----------------------------------------------------------------------- 28 c Declarations: 29 c ------------- 30 31 ! top_bound sponge layer model: 32 ! Quenching is modeled as: A(t)=Am+A0*exp(-lambda*t) 33 ! where Am is the zonal average of the field (or zero), and lambda the inverse 34 ! of the characteristic quenching/relaxation time scale 35 ! Thus, assuming Am to be time-independent, field at time t+dt is given by: 36 ! A(t+dt)=A(t)-(A(t)-Am)*(1-exp(-lambda*t)) 37 ! Moreover lambda can be a function of model level (see below), and relaxation 38 ! can be toward the average zonal field or just zero (see below). 39 40 ! NB: top_bound sponge is only called from leapfrog if ok_strato=.true. 41 42 ! sponge parameters: (loaded/set in conf_gcm.F ; stored in comconst.h) 43 ! iflag_top_bound=0 for no sponge 44 ! iflag_top_bound=1 for sponge over 4 topmost layers 45 ! iflag_top_bound=2 for sponge from top to ~1% of top layer pressure 46 ! mode_top_bound=0: no relaxation 47 ! mode_top_bound=1: u and v relax towards 0 48 ! mode_top_bound=2: u and v relax towards their zonal mean 49 ! mode_top_bound=3: u,v and pot. temp. relax towards their zonal mean 50 ! tau_top_bound : inverse of charactericstic relaxation time scale at 51 ! the topmost layer (Hz) 52 30 53 31 54 #include "comdissipn.h" 55 #include "iniprint.h" 32 56 33 57 c Arguments: 34 58 c ---------- 35 59 36 REAL ucov(iip1,jjb_u:jje_u,llm),vcov(iip1,jjb_v:jje_v,llm) 37 REAL teta(iip1,jjb_u:jje_u,llm) 38 REAL masse(iip1,jjb_u:jje_u,llm) 39 REAL dv(iip1,jjb_v:jje_v,llm),du(iip1,jjb_u:jje_u,llm) 40 REAL dh(iip1,jjb_u:jje_u,llm) 60 real,intent(inout) :: ucov(iip1,jjb_u:jje_u,llm) ! covariant zonal wind 61 real,intent(inout) :: vcov(iip1,jjb_v:jje_v,llm) ! covariant meridional wind 62 real,intent(inout) :: teta(iip1,jjb_u:jje_u,llm) ! potential temperature 63 real,intent(in) :: masse(iip1,jjb_u:jje_u,llm) ! mass of atmosphere 64 real,intent(in) :: dt ! time step (s) of sponge model 65 66 ! REAL dv(iip1,jjb_v:jje_v,llm),du(iip1,jjb_u:jje_u,llm) 67 ! REAL dh(iip1,jjb_u:jje_u,llm) 41 68 42 69 c Local: … … 47 74 REAL tzon(jjb_u:jje_u,llm) 48 75 49 INTEGER NDAMP50 PARAMETER (NDAMP=4)51 76 integer i 52 77 REAL,SAVE :: rdamp(llm) 53 ! & (/(0., i =1,llm-NDAMP),0.125E-5,.25E-5,.5E-5,1.E-5/) 78 real,save :: lambda(llm) ! inverse or quenching time scale (Hz) 54 79 LOGICAL,SAVE :: first=.true. 55 80 INTEGER j,l,jjb,jje … … 57 82 58 83 if (iflag_top_bound == 0) return 84 59 85 if (first) then 60 86 c$OMP BARRIER 61 87 c$OMP MASTER 62 88 if (iflag_top_bound == 1) then 63 ! couche eponge dans les 4 dernieres couches du modele64 rdamp(:)=0.65 rdamp(llm)=tau_top_bound66 rdamp(llm-1)=tau_top_bound/2.67 rdamp(llm-2)=tau_top_bound/4.68 rdamp(llm-3)=tau_top_bound/8.89 ! sponge quenching over the topmost 4 atmospheric layers 90 lambda(:)=0. 91 lambda(llm)=tau_top_bound 92 lambda(llm-1)=tau_top_bound/2. 93 lambda(llm-2)=tau_top_bound/4. 94 lambda(llm-3)=tau_top_bound/8. 69 95 else if (iflag_top_bound == 2) then 70 ! couce eponge dans toutes les couches de pression plus faible que71 ! 100 fois la pression de la derniere couche72 rdamp(:)=tau_top_bound96 ! sponge quenching over topmost layers down to pressures which are 97 ! higher than 100 times the topmost layer pressure 98 lambda(:)=tau_top_bound 73 99 s *max(presnivs(llm)/presnivs(:)-0.01,0.) 74 100 endif 101 102 ! quenching coefficient rdamp(:) 103 ! rdamp(:)=dt*lambda(:) ! Explicit Euler approx. 104 rdamp(:)=1.-exp(-lambda(:)*dt) 105 106 write(lunout,*)'TOP_BOUND mode',mode_top_bound 107 write(lunout,*)'Sponge layer coefficients' 108 write(lunout,*)'p (Pa) z(km) tau(s) 1./tau (Hz)' 109 do l=1,llm 110 if (rdamp(l).ne.0.) then 111 write(lunout,'(6(1pe12.4,1x))') 112 & presnivs(l),log(preff/presnivs(l))*scaleheight, 113 & 1./lambda(l),lambda(l) 114 endif 115 enddo 75 116 first=.false. 76 print*,'TOP_BOUND rdamp=',rdamp77 117 c$OMP END MASTER 78 118 c$OMP BARRIER 79 endif 119 endif ! of if (first) 80 120 81 121 82 122 CALL massbar_loc(masse,massebx,masseby) 83 C CALCUL DES CHAMPS EN MOYENNE ZONALE: 84 85 jjb=jj_begin86 jje=jj_end87 IF (pole_sud) jje=jj_end-188 89 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 90 do l=1,llm123 124 ! compute zonal average of vcov (or set it to zero) 125 if (mode_top_bound.ge.2) then 126 jjb=jj_begin 127 jje=jj_end 128 IF (pole_sud) jje=jj_end-1 129 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 130 do l=1,llm 91 131 do j=jjb,jje 92 132 zm=0. 93 133 vzon(j,l)=0 94 134 do i=1,iim 95 ! Rm: on peut travailler directement avec la moyenne zonale de vcov 96 ! plutot qu'avec celle de v car le coefficient cv qui relie les deux 97 ! ne varie qu'en latitude 135 ! NB: we can work using vcov zonal mean rather than v since the 136 ! cv coefficient (which relates the two) only varies with latitudes 98 137 vzon(j,l)=vzon(j,l)+vcov(i,j,l)*masseby(i,j,l) 99 138 zm=zm+masseby(i,j,l) … … 101 140 vzon(j,l)=vzon(j,l)/zm 102 141 enddo 103 enddo142 enddo 104 143 c$OMP END DO NOWAIT 105 106 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 107 do l=1,llm 108 do j=jjb,jje 109 do i=1,iip1 110 dv(i,j,l)=dv(i,j,l)-rdamp(l)*(vcov(i,j,l)-vzon(j,l)) 111 enddo 112 enddo 113 enddo 114 c$OMP END DO NOWAIT 115 116 jjb=jj_begin 117 jje=jj_end 118 IF (pole_nord) jjb=jj_begin+1 119 IF (pole_sud) jje=jj_end-1 120 121 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 122 do l=1,llm 144 else 145 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 146 do l=1,llm 147 vzon(:,l)=0. 148 enddo 149 c$OMP END DO NOWAIT 150 endif ! of if (mode_top_bound.ge.2) 151 152 ! compute zonal average of u (or set it to zero) 153 if (mode_top_bound.ge.2) then 154 jjb=jj_begin 155 jje=jj_end 156 IF (pole_nord) jjb=jj_begin+1 157 IF (pole_sud) jje=jj_end-1 158 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 159 do l=1,llm 123 160 do j=jjb,jje 124 161 uzon(j,l)=0. … … 130 167 uzon(j,l)=uzon(j,l)/zm 131 168 enddo 132 enddo 133 c$OMP END DO NOWAIT 134 169 enddo 170 c$OMP END DO NOWAIT 171 else 172 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 173 do l=1,llm 174 uzon(:,l)=0. 175 enddo 176 c$OMP END DO NOWAIT 177 endif ! of if (mode_top_bound.ge.2) 178 179 ! compute zonal average of potential temperature, if necessary 180 if (mode_top_bound.ge.3) then 181 jjb=jj_begin 182 jje=jj_end 183 IF (pole_nord) jjb=jj_begin+1 184 IF (pole_sud) jje=jj_end-1 135 185 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 136 do l=1,llm186 do l=1,llm 137 187 do j=jjb,jje 138 188 zm=0. … … 144 194 tzon(j,l)=tzon(j,l)/zm 145 195 enddo 146 enddo 147 c$OMP END DO NOWAIT 148 149 C AMORTISSEMENTS LINEAIRES: 150 151 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 152 do l=1,llm 196 enddo 197 c$OMP END DO NOWAIT 198 endif ! of if (mode_top_bound.ge.3) 199 200 if (mode_top_bound.ge.1) then 201 ! Apply sponge quenching on vcov: 202 jjb=jj_begin 203 jje=jj_end 204 IF (pole_sud) jje=jj_end-1 205 206 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 207 do l=1,llm 153 208 do j=jjb,jje 154 209 do i=1,iip1 155 du(i,j,l)=du(i,j,l) 156 s -rdamp(l)*(ucov(i,j,l)-cu(i,j)*uzon(j,l)) 157 dh(i,j,l)=dh(i,j,l)-rdamp(l)*(teta(i,j,l)-tzon(j,l)) 158 enddo 159 enddo 160 enddo 161 c$OMP END DO NOWAIT 162 163 164 RETURN 210 vcov(i,j,l)=vcov(i,j,l) 211 & -rdamp(l)*(vcov(i,j,l)-vzon(j,l)) 212 enddo 213 enddo 214 enddo 215 c$OMP END DO NOWAIT 216 217 ! Apply sponge quenching on ucov: 218 jjb=jj_begin 219 jje=jj_end 220 IF (pole_nord) jjb=jj_begin+1 221 IF (pole_sud) jje=jj_end-1 222 223 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 224 do l=1,llm 225 do j=jjb,jje 226 do i=1,iip1 227 ucov(i,j,l)=ucov(i,j,l) 228 & -rdamp(l)*(ucov(i,j,l)-cu(i,j)*uzon(j,l)) 229 enddo 230 enddo 231 enddo 232 c$OMP END DO NOWAIT 233 endif ! of if (mode_top_bound.ge.1) 234 235 if (mode_top_bound.ge.3) then 236 ! Apply sponge quenching on teta: 237 jjb=jj_begin 238 jje=jj_end 239 IF (pole_nord) jjb=jj_begin+1 240 IF (pole_sud) jje=jj_end-1 241 242 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 243 do l=1,llm 244 do j=jjb,jje 245 do i=1,iip1 246 teta(i,j,l)=teta(i,j,l) 247 & -rdamp(l)*(teta(i,j,l)-tzon(j,l)) 248 enddo 249 enddo 250 enddo 251 c$OMP END DO NOWAIT 252 endif ! of if (mode_top_bond.ge.3) 253 165 254 END -
LMDZ5/branches/testing/libf/dyn3dpar/abort_gcm.F
r1492 r1795 24 24 25 25 character(len=*) modname 26 integer ierr 26 integer ierr, ierror_mpi 27 27 character(len=*) message 28 28 … … 47 47 else 48 48 write(lunout,*) 'Houston, we have a problem ', ierr 49 #ifdef CPP_MPI 50 C$OMP CRITICAL (MPI_ABORT_GCM) 51 call MPI_ABORT(COMM_LMDZ, 1, ierror_mpi) 52 C$OMP END CRITICAL (MPI_ABORT_GCM) 53 #else 49 54 stop 1 55 #endif 50 56 endif 51 57 END -
LMDZ5/branches/testing/libf/dyn3dpar/ce0l.F90
r1665 r1795 23 23 USE infotrac 24 24 USE parallel, ONLY: finalize_parallel 25 USE indice_sol_mod 25 26 26 27 #ifdef CPP_IOIPSL … … 39 40 #include "dimensions.h" 40 41 #include "paramet.h" 41 #include "indicesol.h"42 !#include "indicesol.h" 42 43 #include "iniprint.h" 43 44 #include "temps.h" -
LMDZ5/branches/testing/libf/dyn3dpar/comconst.h
r1707 r1795 6 6 7 7 COMMON/comconsti/im,jm,lllm,imp1,jmp1,lllmm1,lllmp1,lcl, & 8 & iflag_top_bound 8 & iflag_top_bound,mode_top_bound 9 9 COMMON/comconstr/dtvr,daysec, & 10 10 & pi,dtphys,dtdiss,rad,r,cpp,kappa,cotot,unsim,g,omeg & … … 30 30 REAL omeg ! (rad/s) rotation rate of the planet 31 31 REAL dissip_factz,dissip_deltaz,dissip_zref 32 INTEGER iflag_top_bound 33 REAL tau_top_bound 32 ! top_bound sponge: 33 INTEGER iflag_top_bound ! sponge type 34 INTEGER mode_top_bound ! sponge mode 35 REAL tau_top_bound ! inverse of sponge characteristic time scale (Hz) 34 36 REAL daylen ! length of solar day, in 'standard' day length 35 37 REAL year_day ! Number of standard days in a year -
LMDZ5/branches/testing/libf/dyn3dpar/comvert.h
r1669 r1795 23 23 real bps ! hybrid sigma contribution at mid-layers 24 24 real scaleheight ! atmospheric (reference) scale height (km) 25 real pseudoalt ! for planets 25 real pseudoalt ! pseudo-altitude of model levels (km), based on presnivs(), 26 ! preff and scaleheight 26 27 27 28 integer disvert_type ! type of vertical discretization: -
LMDZ5/branches/testing/libf/dyn3dpar/conf_gcm.F
r1750 r1795 334 334 CALL getin('dissip_zref',dissip_zref ) 335 335 336 ! top_bound sponge: only active if ok_strato=.true. and iflag_top_bound!=0 337 ! iflag_top_bound=0 for no sponge 338 ! iflag_top_bound=1 for sponge over 4 topmost layers 339 ! iflag_top_bound=2 for sponge from top to ~1% of top layer pressure 336 340 iflag_top_bound=1 341 CALL getin('iflag_top_bound',iflag_top_bound) 342 343 ! mode_top_bound : fields towards which sponge relaxation will be done: 344 ! mode_top_bound=0: no relaxation 345 ! mode_top_bound=1: u and v relax towards 0 346 ! mode_top_bound=2: u and v relax towards their zonal mean 347 ! mode_top_bound=3: u,v and pot. temp. relax towards their zonal mean 348 mode_top_bound=3 349 CALL getin('mode_top_bound',mode_top_bound) 350 351 ! top_bound sponge : inverse of charactericstic relaxation time scale for sponge 337 352 tau_top_bound=1.e-5 338 CALL getin('iflag_top_bound',iflag_top_bound)339 353 CALL getin('tau_top_bound',tau_top_bound) 340 354 -
LMDZ5/branches/testing/libf/dyn3dpar/gcm.F
r1707 r1795 19 19 USE filtreg_mod 20 20 USE control_mod 21 22 #ifdef INCA 23 ! Only INCA needs these informations (from the Earth's physics) 24 USE indice_sol_mod 25 #endif 21 26 22 27 #ifdef CPP_PHYS … … 75 80 #ifdef INCA 76 81 ! Only INCA needs these informations (from the Earth's physics) 77 #include "indicesol.h"82 !#include "indicesol.h" 78 83 #endif 79 84 -
LMDZ5/branches/testing/libf/dyn3dpar/inigeom.F
r1403 r1795 426 426 radclatm = 0.5* rad * coslatm 427 427 c 428 ai14 = un4rad2 * coslatp * yprp 429 ai23 = un4rad2 * coslatm * yprm 428 430 DO 32 i = 1,iim 429 431 xprp = xprimp025( i ) 430 432 xprm = xprimm025( i ) 431 433 432 ai14 = un4rad2 * coslatp * yprp433 ai23 = un4rad2 * coslatm * yprm434 434 aireij1 ( i,j ) = ai14 * xprp 435 435 aireij2 ( i,j ) = ai23 * xprp -
LMDZ5/branches/testing/libf/dyn3dpar/leapfrog_p.F
r1707 r1795 904 904 c ajout des tendances physiques: 905 905 c ------------------------------ 906 IF (ok_strato) THEN907 CALL top_bound_p( vcov,ucov,teta,masse,dufi,dvfi,dtetafi)908 ENDIF909 910 906 CALL addfi_p( dtphys, leapf, forward , 911 907 $ ucov, vcov, teta , q ,ps , 912 908 $ dufi, dvfi, dtetafi , dqfi ,dpfi ) 913 909 910 IF (ok_strato) THEN 911 CALL top_bound_p(vcov,ucov,teta,masse,dtphys) 912 ENDIF 913 914 914 c$OMP BARRIER 915 915 c$OMP MASTER … … 1024 1024 ! Sponge layer (if any) 1025 1025 IF (ok_strato) THEN 1026 ! set dufi,dvfi,... to zero 1027 ijb=ij_begin 1028 ije=ij_end 1029 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 1030 do l=1,llm 1031 dufi(ijb:ije,l)=0 1032 dtetafi(ijb:ije,l)=0 1033 dqfi(ijb:ije,l,1:nqtot)=0 1034 enddo 1035 !$OMP END DO 1036 !$OMP MASTER 1037 dpfi(ijb:ije)=0 1038 !$OMP END MASTER 1039 ijb=ij_begin 1040 ije=ij_end 1041 if (pole_sud) ije=ije-iip1 1042 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 1043 do l=1,llm 1044 dvfi(ijb:ije,l)=0 1045 enddo 1046 !$OMP END DO 1047 1048 CALL top_bound_p(vcov,ucov,teta,masse,dufi,dvfi,dtetafi) 1049 CALL addfi_p( dtvr, leapf, forward , 1050 $ ucov, vcov, teta , q ,ps , 1051 $ dufi, dvfi, dtetafi , dqfi ,dpfi ) 1026 CALL top_bound_p(vcov,ucov,teta,masse,dtvr) 1052 1027 !$OMP BARRIER 1053 1028 ENDIF ! of IF (ok_strato) -
LMDZ5/branches/testing/libf/dyn3dpar/temps.h
r1665 r1795 13 13 ! INCLUDE 'temps.h' 14 14 15 COMMON/temps/ itaufin, dt, day_ini, day_end, annee_ref, day_ref,&16 & itau_dyn, itau_phy, jD_ref, jH_ref, calend,&17 & start_time15 COMMON/temps/ dt, jD_ref, jH_ref, start_time, & 16 & day_ini, day_end, annee_ref, day_ref, & 17 & itau_dyn, itau_phy, itaufin, calend 18 18 19 19 20 20 INTEGER itaufin 21 INTEGER itau_dyn, itau_phy 21 INTEGER itau_dyn, itau_phy 22 22 INTEGER day_ini, day_end, annee_ref, day_ref 23 23 REAL dt, jD_ref, jH_ref, start_time -
LMDZ5/branches/testing/libf/dyn3dpar/top_bound_p.F
r1279 r1795 1 SUBROUTINE top_bound_p( vcov,ucov,teta,masse, du,dv,dh ) 1 ! 2 ! $Id$ 3 ! 4 SUBROUTINE top_bound_p(vcov,ucov,teta,masse,dt) 2 5 USE parallel 3 6 IMPLICIT NONE … … 25 28 c 26 29 c======================================================================= 27 c----------------------------------------------------------------------- 28 c Declarations: 29 c ------------- 30 31 ! top_bound sponge layer model: 32 ! Quenching is modeled as: A(t)=Am+A0*exp(-lambda*t) 33 ! where Am is the zonal average of the field (or zero), and lambda the inverse 34 ! of the characteristic quenching/relaxation time scale 35 ! Thus, assuming Am to be time-independent, field at time t+dt is given by: 36 ! A(t+dt)=A(t)-(A(t)-Am)*(1-exp(-lambda*t)) 37 ! Moreover lambda can be a function of model level (see below), and relaxation 38 ! can be toward the average zonal field or just zero (see below). 39 40 ! NB: top_bound sponge is only called from leapfrog if ok_strato=.true. 41 42 ! sponge parameters: (loaded/set in conf_gcm.F ; stored in comconst.h) 43 ! iflag_top_bound=0 for no sponge 44 ! iflag_top_bound=1 for sponge over 4 topmost layers 45 ! iflag_top_bound=2 for sponge from top to ~1% of top layer pressure 46 ! mode_top_bound=0: no relaxation 47 ! mode_top_bound=1: u and v relax towards 0 48 ! mode_top_bound=2: u and v relax towards their zonal mean 49 ! mode_top_bound=3: u,v and pot. temp. relax towards their zonal mean 50 ! tau_top_bound : inverse of charactericstic relaxation time scale at 51 ! the topmost layer (Hz) 52 30 53 31 54 #include "comdissipn.h" 55 #include "iniprint.h" 32 56 33 57 c Arguments: 34 58 c ---------- 35 59 36 REAL ucov(iip1,jjp1,llm),vcov(iip1,jjm,llm),teta(iip1,jjp1,llm) 37 REAL masse(iip1,jjp1,llm) 38 REAL dv(iip1,jjm,llm),du(iip1,jjp1,llm),dh(iip1,jjp1,llm) 60 real,intent(inout) :: ucov(iip1,jjp1,llm) ! covariant zonal wind 61 real,intent(inout) :: vcov(iip1,jjm,llm) ! covariant meridional wind 62 real,intent(inout) :: teta(iip1,jjp1,llm) ! potential temperature 63 real,intent(in) :: masse(iip1,jjp1,llm) ! mass of atmosphere 64 real,intent(in) :: dt ! time step (s) of sponge model 39 65 40 66 c Local: … … 43 69 REAL uzon(jjp1,llm),vzon(jjm,llm),tzon(jjp1,llm) 44 70 45 INTEGER NDAMP46 PARAMETER (NDAMP=4)47 71 integer i 48 REAL,SAVE :: rdamp(llm) 49 ! & (/(0., i =1,llm-NDAMP),0.125E-5,.25E-5,.5E-5,1.E-5/) 72 REAL,SAVE :: rdamp(llm) ! quenching coefficient 73 real,save :: lambda(llm) ! inverse or quenching time scale (Hz) 50 74 LOGICAL,SAVE :: first=.true. 51 75 INTEGER j,l,jjb,jje … … 53 77 54 78 if (iflag_top_bound == 0) return 79 55 80 if (first) then 56 81 c$OMP BARRIER 57 82 c$OMP MASTER 58 83 if (iflag_top_bound == 1) then 59 ! couche eponge dans les 4 dernieres couches du modele60 rdamp(:)=0.61 rdamp(llm)=tau_top_bound62 rdamp(llm-1)=tau_top_bound/2.63 rdamp(llm-2)=tau_top_bound/4.64 rdamp(llm-3)=tau_top_bound/8.84 ! sponge quenching over the topmost 4 atmospheric layers 85 lambda(:)=0. 86 lambda(llm)=tau_top_bound 87 lambda(llm-1)=tau_top_bound/2. 88 lambda(llm-2)=tau_top_bound/4. 89 lambda(llm-3)=tau_top_bound/8. 65 90 else if (iflag_top_bound == 2) then 66 ! couce eponge dans toutes les couches de pression plus faible que67 ! 100 fois la pression de la derniere couche68 rdamp(:)=tau_top_bound91 ! sponge quenching over topmost layers down to pressures which are 92 ! higher than 100 times the topmost layer pressure 93 lambda(:)=tau_top_bound 69 94 s *max(presnivs(llm)/presnivs(:)-0.01,0.) 70 95 endif 96 97 ! quenching coefficient rdamp(:) 98 ! rdamp(:)=dt*lambda(:) ! Explicit Euler approx. 99 rdamp(:)=1.-exp(-lambda(:)*dt) 100 101 write(lunout,*)'TOP_BOUND mode',mode_top_bound 102 write(lunout,*)'Sponge layer coefficients' 103 write(lunout,*)'p (Pa) z(km) tau(s) 1./tau (Hz)' 104 do l=1,llm 105 if (rdamp(l).ne.0.) then 106 write(lunout,'(6(1pe12.4,1x))') 107 & presnivs(l),log(preff/presnivs(l))*scaleheight, 108 & 1./lambda(l),lambda(l) 109 endif 110 enddo 71 111 first=.false. 72 print*,'TOP_BOUND rdamp=',rdamp73 112 c$OMP END MASTER 74 113 c$OMP BARRIER 75 endif 114 endif ! of if (first) 76 115 77 116 78 117 CALL massbar_p(masse,massebx,masseby) 79 C CALCUL DES CHAMPS EN MOYENNE ZONALE: 80 81 jjb=jj_begin82 jje=jj_end83 IF (pole_sud) jje=jj_end-184 85 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 86 do l=1,llm118 119 ! compute zonal average of vcov (or set it to zero) 120 if (mode_top_bound.ge.2) then 121 jjb=jj_begin 122 jje=jj_end 123 IF (pole_sud) jje=jj_end-1 124 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 125 do l=1,llm 87 126 do j=jjb,jje 88 127 zm=0. 89 128 vzon(j,l)=0 90 129 do i=1,iim 91 ! Rm: on peut travailler directement avec la moyenne zonale de vcov 92 ! plutot qu'avec celle de v car le coefficient cv qui relie les deux 93 ! ne varie qu'en latitude 130 ! NB: we can work using vcov zonal mean rather than v since the 131 ! cv coefficient (which relates the two) only varies with latitudes 94 132 vzon(j,l)=vzon(j,l)+vcov(i,j,l)*masseby(i,j,l) 95 133 zm=zm+masseby(i,j,l) … … 97 135 vzon(j,l)=vzon(j,l)/zm 98 136 enddo 99 enddo137 enddo 100 138 c$OMP END DO NOWAIT 101 102 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 103 do l=1,llm 104 do j=jjb,jje 105 do i=1,iip1 106 dv(i,j,l)=dv(i,j,l)-rdamp(l)*(vcov(i,j,l)-vzon(j,l)) 107 enddo 108 enddo 109 enddo 110 c$OMP END DO NOWAIT 111 112 jjb=jj_begin 113 jje=jj_end 114 IF (pole_nord) jjb=jj_begin+1 115 IF (pole_sud) jje=jj_end-1 116 117 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 118 do l=1,llm 139 else 140 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 141 do l=1,llm 142 vzon(:,l)=0. 143 enddo 144 c$OMP END DO NOWAIT 145 endif ! of if (mode_top_bound.ge.2) 146 147 ! compute zonal average of u (or set it to zero) 148 if (mode_top_bound.ge.2) then 149 jjb=jj_begin 150 jje=jj_end 151 IF (pole_nord) jjb=jj_begin+1 152 IF (pole_sud) jje=jj_end-1 153 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 154 do l=1,llm 119 155 do j=jjb,jje 120 156 uzon(j,l)=0. … … 126 162 uzon(j,l)=uzon(j,l)/zm 127 163 enddo 128 enddo 129 c$OMP END DO NOWAIT 130 164 enddo 165 c$OMP END DO NOWAIT 166 else 167 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 168 do l=1,llm 169 uzon(:,l)=0. 170 enddo 171 c$OMP END DO NOWAIT 172 endif ! of if (mode_top_bound.ge.2) 173 174 ! compute zonal average of potential temperature, if necessary 175 if (mode_top_bound.ge.3) then 176 jjb=jj_begin 177 jje=jj_end 178 IF (pole_nord) jjb=jj_begin+1 179 IF (pole_sud) jje=jj_end-1 131 180 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 132 do l=1,llm181 do l=1,llm 133 182 do j=jjb,jje 134 183 zm=0. … … 140 189 tzon(j,l)=tzon(j,l)/zm 141 190 enddo 142 enddo 143 c$OMP END DO NOWAIT 144 145 C AMORTISSEMENTS LINEAIRES: 146 147 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 148 do l=1,llm 191 enddo 192 c$OMP END DO NOWAIT 193 endif ! of if (mode_top_bound.ge.3) 194 195 if (mode_top_bound.ge.1) then 196 ! Apply sponge quenching on vcov: 197 jjb=jj_begin 198 jje=jj_end 199 IF (pole_sud) jje=jj_end-1 200 201 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 202 do l=1,llm 149 203 do j=jjb,jje 150 204 do i=1,iip1 151 du(i,j,l)=du(i,j,l) 152 s -rdamp(l)*(ucov(i,j,l)-cu(i,j)*uzon(j,l)) 153 dh(i,j,l)=dh(i,j,l)-rdamp(l)*(teta(i,j,l)-tzon(j,l)) 154 enddo 155 enddo 156 enddo 157 c$OMP END DO NOWAIT 158 159 160 RETURN 205 vcov(i,j,l)=vcov(i,j,l) 206 & -rdamp(l)*(vcov(i,j,l)-vzon(j,l)) 207 enddo 208 enddo 209 enddo 210 c$OMP END DO NOWAIT 211 212 ! Apply sponge quenching on ucov: 213 jjb=jj_begin 214 jje=jj_end 215 IF (pole_nord) jjb=jj_begin+1 216 IF (pole_sud) jje=jj_end-1 217 218 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 219 do l=1,llm 220 do j=jjb,jje 221 do i=1,iip1 222 ucov(i,j,l)=ucov(i,j,l) 223 & -rdamp(l)*(ucov(i,j,l)-cu(i,j)*uzon(j,l)) 224 enddo 225 enddo 226 enddo 227 c$OMP END DO NOWAIT 228 endif ! of if (mode_top_bound.ge.1) 229 230 if (mode_top_bound.ge.3) then 231 ! Apply sponge quenching on teta: 232 jjb=jj_begin 233 jje=jj_end 234 IF (pole_nord) jjb=jj_begin+1 235 IF (pole_sud) jje=jj_end-1 236 237 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 238 do l=1,llm 239 do j=jjb,jje 240 do i=1,iip1 241 teta(i,j,l)=teta(i,j,l) 242 & -rdamp(l)*(teta(i,j,l)-tzon(j,l)) 243 enddo 244 enddo 245 enddo 246 c$OMP END DO NOWAIT 247 endif ! of if (mode_top_bond.ge.3) 248 161 249 END -
LMDZ5/branches/testing/libf/phy1d/1DUTILS.h_no_writelim
r1707 r1795 27 27 #include "compar1d.h" 28 28 #include "flux_arp.h" 29 #include "tsoilnudge.h" 29 30 #include "fcg_gcssold.h" 30 31 #include "fcg_racmo.h" … … 100 101 ! initial profiles from RICO idealized 101 102 ! LS convergence imposed from RICO (cst) 103 ! = 6 ==> forcing_amma = .true. 102 104 ! = 40 ==> forcing_GCSSold = .true. 103 105 ! initial profile from GCSS file 104 106 ! LS convergence imposed from GCSS file 107 ! = 59 ==> forcing_sandu = .true. 108 ! initial profiles from sanduref file: see prof.inp.001 109 ! SST varying with time and divergence constante: see ifa_sanduref.txt file 110 ! Radiation has to be computed interactively 111 ! = 60 ==> forcing_astex = .true. 112 ! initial profiles from file: see prof.inp.001 113 ! SST,divergence,ug,vg,ufa,vfa varying with time : see ifa_astex.txt file 114 ! Radiation has to be computed interactively 115 ! = 61 ==> forcing_armcu = .true. 116 ! initial profiles from file: see prof.inp.001 117 ! sensible and latent heat flux imposed: see ifa_arm_cu_1.txt 118 ! large scale advective forcing & radiative tendencies applied below 1000m: see ifa_arm_cu_2.txt 119 ! use geostrophic wind ug=10m/s vg=0m/s. Duration of the case 53100s 120 ! Radiation to be switched off 105 121 ! 106 122 forcing_type = 0 … … 126 142 CALL getin('ok_flux_surf',ok_flux_surf) 127 143 144 !Config Key = ok_old_disvert 145 !Config Desc = utilisation de l ancien programme disvert0 (dans 1DUTILS.h) 146 !Config Def = false 147 !Config Help = utilisation de l ancien programme disvert0 (dans 1DUTILS.h) 148 ok_old_disvert = .FALSE. 149 CALL getin('ok_old_disvert',ok_old_disvert) 150 128 151 !Config Key = time_ini 129 152 !Config Desc = meaningless in this case … … 227 250 zpicinp = 300. 228 251 CALL getin('zpicinp',zpicinp) 252 !Config key = nudge_tsoil 253 !Config Desc = activation of soil temperature nudging 254 !Config Def = .FALSE. 255 !Config Help = ... 256 257 nudge_tsoil=.FALSE. 258 CALL getin('nudge_tsoil',nudge_tsoil) 259 260 !Config key = isoil_nudge 261 !Config Desc = level number where soil temperature is nudged 262 !Config Def = 3 263 !Config Help = ... 264 265 isoil_nudge=3 266 CALL getin('isoil_nudge',isoil_nudge) 267 268 !Config key = Tsoil_nudge 269 !Config Desc = target temperature for tsoil(isoil_nudge) 270 !Config Def = 300. 271 !Config Help = ... 272 273 Tsoil_nudge=300. 274 CALL getin('Tsoil_nudge',Tsoil_nudge) 275 276 !Config key = tau_soil_nudge 277 !Config Desc = nudging relaxation time for tsoil 278 !Config Def = 3600. 279 !Config Help = ... 280 281 tau_soil_nudge=3600. 282 CALL getin('tau_soil_nudge',tau_soil_nudge) 283 284 229 285 230 286 … … 250 306 write(lunout,*)' qsolinp = ', qsolinp 251 307 write(lunout,*)' zpicinp = ', zpicinp 308 write(lunout,*)' nudge_tsoil = ', nudge_tsoil 309 write(lunout,*)' isoil_nudge = ', isoil_nudge 310 write(lunout,*)' Tsoil_nudge = ', Tsoil_nudge 311 write(lunout,*)' tau_soil_nudge = ', tau_soil_nudge 252 312 IF (forcing_type .eq.40) THEN 253 313 write(lunout,*) '--- Forcing type GCSS Old --- with:' … … 703 763 RETURN 704 764 END 705 subroutine scopy(n,sx,incx,sy,incy)706 !707 IMPLICIT NONE708 !709 integer n,incx,incy,ix,iy,i710 real sx((n-1)*incx+1),sy((n-1)*incy+1)711 !712 iy=1713 ix=1714 do 10 i=1,n715 sy(iy)=sx(ix)716 ix=ix+incx717 iy=iy+incy718 10 continue719 !720 return721 end722 765 subroutine wrgradsfi(if,nl,field,name,titlevar) 723 766 implicit none … … 956 999 END 957 1000 958 SUBROUTINE disvert(pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig) 959 1001 SUBROUTINE disvert0(pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig) 1002 1003 ! Ancienne version disvert dont on a modifie nom pour utiliser 1004 ! le disvert de dyn3d (qui permet d'utiliser grille avec ab,bp imposes) 1005 ! (MPL 18092012) 1006 ! 960 1007 ! Auteur : P. Le Van . 961 1008 ! … … 1402 1449 end 1403 1450 1451 c------------------------------------------------------------------------- 1452 SUBROUTINE read_sandu(fich_sandu,nlev_sandu,nt_sandu,ts_sandu) 1453 implicit none 1454 1455 c------------------------------------------------------------------------- 1456 c Read I.SANDU case forcing data 1457 c------------------------------------------------------------------------- 1458 1459 integer nlev_sandu,nt_sandu 1460 real ts_sandu(nt_sandu) 1461 character*80 fich_sandu 1462 1463 integer no,l,k,ip 1464 real riy,rim,rid,rih,bid 1465 1466 integer iy,im,id,ih 1467 1468 real plev_min 1469 1470 plev_min = 55000. ! pas de tendance de vap. d eau au-dessus de 55 hPa 1471 1472 open(21,file=trim(fich_sandu),form='formatted') 1473 read(21,'(a)') 1474 do ip = 1, nt_sandu 1475 read(21,'(a)') 1476 read(21,'(a)') 1477 read(21,223) iy, im, id, ih, ts_sandu(ip) 1478 print *,'ts=',iy,im,id,ih,ip,ts_sandu(ip) 1479 enddo 1480 close(21) 1481 1482 223 format(4i3,f8.2) 1483 226 format(f7.1,1x,10f8.2) 1484 227 format(f7.1,1x,1p,4e11.3) 1485 230 format(6f9.3,4e11.3) 1486 1487 return 1488 end 1489 1490 !===================================================================== 1491 c------------------------------------------------------------------------- 1492 SUBROUTINE read_astex(fich_astex,nlev_astex,nt_astex,div_astex, 1493 : ts_astex,ug_astex,vg_astex,ufa_astex,vfa_astex) 1494 implicit none 1495 1496 c------------------------------------------------------------------------- 1497 c Read Astex case forcing data 1498 c------------------------------------------------------------------------- 1499 1500 integer nlev_astex,nt_astex 1501 real div_astex(nt_astex),ts_astex(nt_astex),ug_astex(nt_astex) 1502 real vg_astex(nt_astex),ufa_astex(nt_astex),vfa_astex(nt_astex) 1503 character*80 fich_astex 1504 1505 integer no,l,k,ip 1506 real riy,rim,rid,rih,bid 1507 1508 integer iy,im,id,ih 1509 1510 real plev_min 1511 1512 plev_min = 55000. ! pas de tendance de vap. d eau au-dessus de 55 hPa 1513 1514 open(21,file=trim(fich_astex),form='formatted') 1515 read(21,'(a)') 1516 read(21,'(a)') 1517 do ip = 1, nt_astex 1518 read(21,'(a)') 1519 read(21,'(a)') 1520 read(21,223) iy, im, id, ih, div_astex(ip),ts_astex(ip), 1521 :ug_astex(ip),vg_astex(ip),ufa_astex(ip),vfa_astex(ip) 1522 ts_astex(ip)=ts_astex(ip)+273.15 1523 print *,'ts=',iy,im,id,ih,ip,div_astex(ip),ts_astex(ip), 1524 :ug_astex(ip),vg_astex(ip),ufa_astex(ip),vg_astex(ip) 1525 enddo 1526 close(21) 1527 1528 223 format(4i3,e13.2,f7.2,f7.3,f7.2,f7.3,f7.2) 1529 226 format(f7.1,1x,10f8.2) 1530 227 format(f7.1,1x,1p,4e11.3) 1531 230 format(6f9.3,4e11.3) 1532 1533 return 1534 end 1404 1535 !===================================================================== 1405 1536 subroutine read_twpice(fich_twpice,nlevel,ntime … … 1884 2015 return 1885 2016 end 2017 !===================================================================== 2018 2019 SUBROUTINE interp_sandu_vertical(play,nlev_sandu,plev_prof 2020 : ,t_prof,thl_prof,q_prof,u_prof,v_prof,w_prof 2021 : ,omega_prof,o3mmr_prof 2022 : ,t_mod,thl_mod,q_mod,u_mod,v_mod,w_mod 2023 : ,omega_mod,o3mmr_mod,mxcalc) 2024 2025 implicit none 2026 2027 #include "dimensions.h" 2028 2029 c------------------------------------------------------------------------- 2030 c Vertical interpolation of SANDUREF forcing data onto model levels 2031 c------------------------------------------------------------------------- 2032 2033 integer nlevmax 2034 parameter (nlevmax=41) 2035 integer nlev_sandu,mxcalc 2036 ! real play(llm), plev_prof(nlevmax) 2037 ! real t_prof(nlevmax),q_prof(nlevmax) 2038 ! real u_prof(nlevmax),v_prof(nlevmax), w_prof(nlevmax) 2039 ! real ht_prof(nlevmax),vt_prof(nlevmax) 2040 ! real hq_prof(nlevmax),vq_prof(nlevmax) 2041 2042 real play(llm), plev_prof(nlev_sandu) 2043 real t_prof(nlev_sandu),thl_prof(nlev_sandu),q_prof(nlev_sandu) 2044 real u_prof(nlev_sandu),v_prof(nlev_sandu), w_prof(nlev_sandu) 2045 real omega_prof(nlev_sandu),o3mmr_prof(nlev_sandu) 2046 2047 real t_mod(llm),thl_mod(llm),q_mod(llm) 2048 real u_mod(llm),v_mod(llm), w_mod(llm) 2049 real omega_mod(llm),o3mmr_mod(llm) 2050 2051 integer l,k,k1,k2,kp 2052 real aa,frac,frac1,frac2,fact 2053 2054 do l = 1, llm 2055 2056 if (play(l).ge.plev_prof(nlev_sandu)) then 2057 2058 mxcalc=l 2059 k1=0 2060 k2=0 2061 2062 if (play(l).le.plev_prof(1)) then 2063 2064 do k = 1, nlev_sandu-1 2065 if (play(l).le.plev_prof(k) 2066 : .and. play(l).gt.plev_prof(k+1)) then 2067 k1=k 2068 k2=k+1 2069 endif 2070 enddo 2071 2072 if (k1.eq.0 .or. k2.eq.0) then 2073 write(*,*) 'PB! k1, k2 = ',k1,k2 2074 write(*,*) 'l,play(l) = ',l,play(l)/100 2075 do k = 1, nlev_sandu-1 2076 write(*,*) 'k,plev_prof(k) = ',k,plev_prof(k)/100 2077 enddo 2078 endif 2079 2080 frac = (plev_prof(k2)-play(l))/(plev_prof(k2)-plev_prof(k1)) 2081 t_mod(l)= t_prof(k2) - frac*(t_prof(k2)-t_prof(k1)) 2082 thl_mod(l)= thl_prof(k2) - frac*(thl_prof(k2)-thl_prof(k1)) 2083 q_mod(l)= q_prof(k2) - frac*(q_prof(k2)-q_prof(k1)) 2084 u_mod(l)= u_prof(k2) - frac*(u_prof(k2)-u_prof(k1)) 2085 v_mod(l)= v_prof(k2) - frac*(v_prof(k2)-v_prof(k1)) 2086 w_mod(l)= w_prof(k2) - frac*(w_prof(k2)-w_prof(k1)) 2087 omega_mod(l)=omega_prof(k2)- 2088 : frac*(omega_prof(k2)-omega_prof(k1)) 2089 o3mmr_mod(l)=o3mmr_prof(k2)- 2090 : frac*(o3mmr_prof(k2)-o3mmr_prof(k1)) 2091 2092 else !play>plev_prof(1) 2093 2094 k1=1 2095 k2=2 2096 frac1 = (play(l)-plev_prof(k2))/(plev_prof(k1)-plev_prof(k2)) 2097 frac2 = (play(l)-plev_prof(k1))/(plev_prof(k1)-plev_prof(k2)) 2098 t_mod(l)= frac1*t_prof(k1) - frac2*t_prof(k2) 2099 thl_mod(l)= frac1*thl_prof(k1) - frac2*thl_prof(k2) 2100 q_mod(l)= frac1*q_prof(k1) - frac2*q_prof(k2) 2101 u_mod(l)= frac1*u_prof(k1) - frac2*u_prof(k2) 2102 v_mod(l)= frac1*v_prof(k1) - frac2*v_prof(k2) 2103 w_mod(l)= frac1*w_prof(k1) - frac2*w_prof(k2) 2104 omega_mod(l)= frac1*omega_prof(k1) - frac2*omega_prof(k2) 2105 o3mmr_mod(l)= frac1*o3mmr_prof(k1) - frac2*o3mmr_prof(k2) 2106 2107 endif ! play.le.plev_prof(1) 2108 2109 else ! above max altitude of forcing file 2110 2111 cjyg 2112 fact=20.*(plev_prof(nlev_sandu)-play(l))/plev_prof(nlev_sandu) !jyg 2113 fact = max(fact,0.) !jyg 2114 fact = exp(-fact) !jyg 2115 t_mod(l)= t_prof(nlev_sandu) !jyg 2116 thl_mod(l)= thl_prof(nlev_sandu) !jyg 2117 q_mod(l)= q_prof(nlev_sandu)*fact !jyg 2118 u_mod(l)= u_prof(nlev_sandu)*fact !jyg 2119 v_mod(l)= v_prof(nlev_sandu)*fact !jyg 2120 w_mod(l)= w_prof(nlev_sandu)*fact !jyg 2121 omega_mod(l)= omega_prof(nlev_sandu)*fact !jyg 2122 o3mmr_mod(l)= o3mmr_prof(nlev_sandu)*fact !jyg 2123 2124 endif ! play 2125 2126 enddo ! l 2127 2128 do l = 1,llm 2129 ! print *,'t_mod(l),thl_mod(l),q_mod(l),u_mod(l),v_mod(l) ', 2130 ! $ l,t_mod(l),thl_mod(l),q_mod(l),u_mod(l),v_mod(l) 2131 enddo 2132 2133 return 2134 end 2135 !===================================================================== 2136 SUBROUTINE interp_astex_vertical(play,nlev_astex,plev_prof 2137 : ,t_prof,thl_prof,qv_prof,ql_prof,qt_prof,u_prof,v_prof 2138 : ,w_prof,tke_prof,o3mmr_prof 2139 : ,t_mod,thl_mod,qv_mod,ql_mod,qt_mod,u_mod,v_mod,w_mod 2140 : ,tke_mod,o3mmr_mod,mxcalc) 2141 2142 implicit none 2143 2144 #include "dimensions.h" 2145 2146 c------------------------------------------------------------------------- 2147 c Vertical interpolation of Astex forcing data onto model levels 2148 c------------------------------------------------------------------------- 2149 2150 integer nlevmax 2151 parameter (nlevmax=41) 2152 integer nlev_astex,mxcalc 2153 ! real play(llm), plev_prof(nlevmax) 2154 ! real t_prof(nlevmax),qv_prof(nlevmax) 2155 ! real u_prof(nlevmax),v_prof(nlevmax), w_prof(nlevmax) 2156 ! real ht_prof(nlevmax),vt_prof(nlevmax) 2157 ! real hq_prof(nlevmax),vq_prof(nlevmax) 2158 2159 real play(llm), plev_prof(nlev_astex) 2160 real t_prof(nlev_astex),thl_prof(nlev_astex),qv_prof(nlev_astex) 2161 real u_prof(nlev_astex),v_prof(nlev_astex), w_prof(nlev_astex) 2162 real o3mmr_prof(nlev_astex),ql_prof(nlev_astex) 2163 real qt_prof(nlev_astex),tke_prof(nlev_astex) 2164 2165 real t_mod(llm),thl_mod(llm),qv_mod(llm) 2166 real u_mod(llm),v_mod(llm), w_mod(llm),tke_mod(llm) 2167 real o3mmr_mod(llm),ql_mod(llm),qt_mod(llm) 2168 2169 integer l,k,k1,k2,kp 2170 real aa,frac,frac1,frac2,fact 2171 2172 do l = 1, llm 2173 2174 if (play(l).ge.plev_prof(nlev_astex)) then 2175 2176 mxcalc=l 2177 k1=0 2178 k2=0 2179 2180 if (play(l).le.plev_prof(1)) then 2181 2182 do k = 1, nlev_astex-1 2183 if (play(l).le.plev_prof(k) 2184 : .and. play(l).gt.plev_prof(k+1)) then 2185 k1=k 2186 k2=k+1 2187 endif 2188 enddo 2189 2190 if (k1.eq.0 .or. k2.eq.0) then 2191 write(*,*) 'PB! k1, k2 = ',k1,k2 2192 write(*,*) 'l,play(l) = ',l,play(l)/100 2193 do k = 1, nlev_astex-1 2194 write(*,*) 'k,plev_prof(k) = ',k,plev_prof(k)/100 2195 enddo 2196 endif 2197 2198 frac = (plev_prof(k2)-play(l))/(plev_prof(k2)-plev_prof(k1)) 2199 t_mod(l)= t_prof(k2) - frac*(t_prof(k2)-t_prof(k1)) 2200 thl_mod(l)= thl_prof(k2) - frac*(thl_prof(k2)-thl_prof(k1)) 2201 qv_mod(l)= qv_prof(k2) - frac*(qv_prof(k2)-qv_prof(k1)) 2202 ql_mod(l)= ql_prof(k2) - frac*(ql_prof(k2)-ql_prof(k1)) 2203 qt_mod(l)= qt_prof(k2) - frac*(qt_prof(k2)-qt_prof(k1)) 2204 u_mod(l)= u_prof(k2) - frac*(u_prof(k2)-u_prof(k1)) 2205 v_mod(l)= v_prof(k2) - frac*(v_prof(k2)-v_prof(k1)) 2206 w_mod(l)= w_prof(k2) - frac*(w_prof(k2)-w_prof(k1)) 2207 tke_mod(l)= tke_prof(k2) - frac*(tke_prof(k2)-tke_prof(k1)) 2208 o3mmr_mod(l)=o3mmr_prof(k2)- 2209 : frac*(o3mmr_prof(k2)-o3mmr_prof(k1)) 2210 2211 else !play>plev_prof(1) 2212 2213 k1=1 2214 k2=2 2215 frac1 = (play(l)-plev_prof(k2))/(plev_prof(k1)-plev_prof(k2)) 2216 frac2 = (play(l)-plev_prof(k1))/(plev_prof(k1)-plev_prof(k2)) 2217 t_mod(l)= frac1*t_prof(k1) - frac2*t_prof(k2) 2218 thl_mod(l)= frac1*thl_prof(k1) - frac2*thl_prof(k2) 2219 qv_mod(l)= frac1*qv_prof(k1) - frac2*qv_prof(k2) 2220 ql_mod(l)= frac1*ql_prof(k1) - frac2*ql_prof(k2) 2221 qt_mod(l)= frac1*qt_prof(k1) - frac2*qt_prof(k2) 2222 u_mod(l)= frac1*u_prof(k1) - frac2*u_prof(k2) 2223 v_mod(l)= frac1*v_prof(k1) - frac2*v_prof(k2) 2224 w_mod(l)= frac1*w_prof(k1) - frac2*w_prof(k2) 2225 tke_mod(l)= frac1*tke_prof(k1) - frac2*tke_prof(k2) 2226 o3mmr_mod(l)= frac1*o3mmr_prof(k1) - frac2*o3mmr_prof(k2) 2227 2228 endif ! play.le.plev_prof(1) 2229 2230 else ! above max altitude of forcing file 2231 2232 cjyg 2233 fact=20.*(plev_prof(nlev_astex)-play(l))/plev_prof(nlev_astex) !jyg 2234 fact = max(fact,0.) !jyg 2235 fact = exp(-fact) !jyg 2236 t_mod(l)= t_prof(nlev_astex) !jyg 2237 thl_mod(l)= thl_prof(nlev_astex) !jyg 2238 qv_mod(l)= qv_prof(nlev_astex)*fact !jyg 2239 ql_mod(l)= ql_prof(nlev_astex)*fact !jyg 2240 qt_mod(l)= qt_prof(nlev_astex)*fact !jyg 2241 u_mod(l)= u_prof(nlev_astex)*fact !jyg 2242 v_mod(l)= v_prof(nlev_astex)*fact !jyg 2243 w_mod(l)= w_prof(nlev_astex)*fact !jyg 2244 tke_mod(l)= tke_prof(nlev_astex)*fact !jyg 2245 o3mmr_mod(l)= o3mmr_prof(nlev_astex)*fact !jyg 2246 2247 endif ! play 2248 2249 enddo ! l 2250 2251 do l = 1,llm 2252 ! print *,'t_mod(l),thl_mod(l),qv_mod(l),u_mod(l),v_mod(l) ', 2253 ! $ l,t_mod(l),thl_mod(l),qv_mod(l),u_mod(l),v_mod(l) 2254 enddo 2255 2256 return 2257 end 1886 2258 1887 2259 !====================================================================== … … 2048 2420 end 2049 2421 2422 !====================================================================== 2423 SUBROUTINE interp_sandu_time(day,day1,annee_ref 2424 i ,year_ini_sandu,day_ini_sandu,nt_sandu,dt_sandu 2425 i ,nlev_sandu,ts_sandu,ts_prof) 2426 implicit none 2427 2428 !--------------------------------------------------------------------------------------- 2429 ! Time interpolation of a 2D field to the timestep corresponding to day 2430 ! 2431 ! day: current julian day (e.g. 717538.2) 2432 ! day1: first day of the simulation 2433 ! nt_sandu: total nb of data in the forcing (e.g. 13 for Sanduref) 2434 ! dt_sandu: total time interval (in sec) between 2 forcing data (e.g. 6h for Sanduref) 2435 !--------------------------------------------------------------------------------------- 2436 ! inputs: 2437 integer annee_ref 2438 integer nt_sandu,nlev_sandu 2439 integer year_ini_sandu 2440 real day, day1,day_ini_sandu,dt_sandu 2441 real ts_sandu(nt_sandu) 2442 ! outputs: 2443 real ts_prof 2444 ! local: 2445 integer it_sandu1, it_sandu2,k 2446 real timeit,time_sandu1,time_sandu2,frac 2447 ! Check that initial day of the simulation consistent with SANDU period: 2448 if (annee_ref.ne.2006 ) then 2449 print*,'Pour SANDUREF, annee_ref doit etre 2006 ' 2450 print*,'Changer annee_ref dans run.def' 2451 stop 2452 endif 2453 ! if (annee_ref.eq.2006 .and. day1.lt.day_ini_sandu) then 2454 ! print*,'SANDUREF debute le 15 Juillet 2006 (jour julien=196)' 2455 ! print*,'Changer dayref dans run.def' 2456 ! stop 2457 ! endif 2458 2459 ! Determine timestep relative to the 1st day of TOGA-COARE: 2460 ! timeit=(day-day1)*86400. 2461 ! if (annee_ref.eq.1992) then 2462 ! timeit=(day-day_ini_sandu)*86400. 2463 ! else 2464 ! timeit=(day+61.-1.)*86400. ! 61 days between Nov01 and Dec31 1992 2465 ! endif 2466 timeit=(day-day_ini_sandu)*86400 2467 2468 ! Determine the closest observation times: 2469 it_sandu1=INT(timeit/dt_sandu)+1 2470 it_sandu2=it_sandu1 + 1 2471 time_sandu1=(it_sandu1-1)*dt_sandu 2472 time_sandu2=(it_sandu2-1)*dt_sandu 2473 print *,'timeit day day_ini_sandu',timeit,day,day_ini_sandu 2474 print *,'it_sandu1,it_sandu2,time_sandu1,time_sandu2', 2475 . it_sandu1,it_sandu2,time_sandu1,time_sandu2 2476 2477 if (it_sandu1 .ge. nt_sandu) then 2478 write(*,*) 'PB-stop: day, it_sandu1, it_sandu2, timeit: ' 2479 : ,day,it_sandu1,it_sandu2,timeit/86400. 2480 stop 2481 endif 2482 2483 ! time interpolation: 2484 frac=(time_sandu2-timeit)/(time_sandu2-time_sandu1) 2485 frac=max(frac,0.0) 2486 2487 ts_prof = ts_sandu(it_sandu2) 2488 : -frac*(ts_sandu(it_sandu2)-ts_sandu(it_sandu1)) 2489 2490 print*, 2491 :'day,annee_ref,day_ini_sandu,timeit,it_sandu1,it_sandu2,SST:', 2492 :day,annee_ref,day_ini_sandu,timeit/86400.,it_sandu1, 2493 :it_sandu2,ts_prof 2494 2495 return 2496 END 2050 2497 !===================================================================== 2051 2498 c------------------------------------------------------------------------- … … 2209 2656 end 2210 2657 2658 !====================================================================== 2659 SUBROUTINE interp_astex_time(day,day1,annee_ref 2660 i ,year_ini_astex,day_ini_astex,nt_astex,dt_astex 2661 i ,nlev_astex,div_astex,ts_astex,ug_astex,vg_astex 2662 i ,ufa_astex,vfa_astex,div_prof,ts_prof,ug_prof,vg_prof 2663 i ,ufa_prof,vfa_prof) 2664 implicit none 2665 2666 !--------------------------------------------------------------------------------------- 2667 ! Time interpolation of a 2D field to the timestep corresponding to day 2668 ! 2669 ! day: current julian day (e.g. 717538.2) 2670 ! day1: first day of the simulation 2671 ! nt_astex: total nb of data in the forcing (e.g. 41 for Astex) 2672 ! dt_astex: total time interval (in sec) between 2 forcing data (e.g. 1h for Astex) 2673 !--------------------------------------------------------------------------------------- 2674 2675 ! inputs: 2676 integer annee_ref 2677 integer nt_astex,nlev_astex 2678 integer year_ini_astex 2679 real day, day1,day_ini_astex,dt_astex 2680 real div_astex(nt_astex),ts_astex(nt_astex),ug_astex(nt_astex) 2681 real vg_astex(nt_astex),ufa_astex(nt_astex),vfa_astex(nt_astex) 2682 ! outputs: 2683 real div_prof,ts_prof,ug_prof,vg_prof,ufa_prof,vfa_prof 2684 ! local: 2685 integer it_astex1, it_astex2,k 2686 real timeit,time_astex1,time_astex2,frac 2687 2688 ! Check that initial day of the simulation consistent with ASTEX period: 2689 if (annee_ref.ne.1992 ) then 2690 print*,'Pour Astex, annee_ref doit etre 1992 ' 2691 print*,'Changer annee_ref dans run.def' 2692 stop 2693 endif 2694 if (annee_ref.eq.1992 .and. day1.lt.day_ini_astex) then 2695 print*,'Astex debute le 13 Juin 1992 (jour julien=165)' 2696 print*,'Changer dayref dans run.def' 2697 stop 2698 endif 2699 2700 ! Determine timestep relative to the 1st day of TOGA-COARE: 2701 ! timeit=(day-day1)*86400. 2702 ! if (annee_ref.eq.1992) then 2703 ! timeit=(day-day_ini_astex)*86400. 2704 ! else 2705 ! timeit=(day+2.-1.)*86400. ! 2 days between Jun13 and Jun15 1992 2706 ! endif 2707 timeit=(day-day_ini_astex)*86400 2708 2709 ! Determine the closest observation times: 2710 it_astex1=INT(timeit/dt_astex)+1 2711 it_astex2=it_astex1 + 1 2712 time_astex1=(it_astex1-1)*dt_astex 2713 time_astex2=(it_astex2-1)*dt_astex 2714 print *,'timeit day day_ini_astex',timeit,day,day_ini_astex 2715 print *,'it_astex1,it_astex2,time_astex1,time_astex2', 2716 . it_astex1,it_astex2,time_astex1,time_astex2 2717 2718 if (it_astex1 .ge. nt_astex) then 2719 write(*,*) 'PB-stop: day, it_astex1, it_astex2, timeit: ' 2720 : ,day,it_astex1,it_astex2,timeit/86400. 2721 stop 2722 endif 2723 2724 ! time interpolation: 2725 frac=(time_astex2-timeit)/(time_astex2-time_astex1) 2726 frac=max(frac,0.0) 2727 2728 div_prof = div_astex(it_astex2) 2729 : -frac*(div_astex(it_astex2)-div_astex(it_astex1)) 2730 ts_prof = ts_astex(it_astex2) 2731 : -frac*(ts_astex(it_astex2)-ts_astex(it_astex1)) 2732 ug_prof = ug_astex(it_astex2) 2733 : -frac*(ug_astex(it_astex2)-ug_astex(it_astex1)) 2734 vg_prof = vg_astex(it_astex2) 2735 : -frac*(vg_astex(it_astex2)-vg_astex(it_astex1)) 2736 ufa_prof = ufa_astex(it_astex2) 2737 : -frac*(ufa_astex(it_astex2)-ufa_astex(it_astex1)) 2738 vfa_prof = vfa_astex(it_astex2) 2739 : -frac*(vfa_astex(it_astex2)-vfa_astex(it_astex1)) 2740 2741 print*, 2742 :'day,annee_ref,day_ini_astex,timeit,it_astex1,it_astex2,SST:', 2743 :day,annee_ref,day_ini_astex,timeit/86400.,it_astex1, 2744 :it_astex2,div_prof,ts_prof,ug_prof,vg_prof,ufa_prof,vfa_prof 2745 2746 return 2747 END 2748 2211 2749 !====================================================================== 2212 2750 SUBROUTINE interp_toga_time(day,day1,annee_ref … … 2479 3017 return 2480 3018 end 3019 !====================================================================== 3020 subroutine readprofile_sandu(nlev_max,kmax,height,pprof,tprof, 3021 . thlprof,qprof,uprof,vprof,wprof,omega,o3mmr) 3022 !====================================================================== 3023 implicit none 3024 3025 integer nlev_max,kmax,kmax2 3026 logical :: llesread = .true. 3027 3028 real height(nlev_max),pprof(nlev_max),tprof(nlev_max), 3029 . thlprof(nlev_max), 3030 . qprof(nlev_max),uprof(nlev_max),vprof(nlev_max), 3031 . wprof(nlev_max),omega(nlev_max),o3mmr(nlev_max) 3032 3033 integer, parameter :: ilesfile=1 3034 integer :: ierr,irad,imax,jtot,k 3035 logical :: lmoist,lcoriol,ltimedep 3036 real :: xsize,ysize 3037 real :: ustin,wsvsurf,timerad 3038 character(80) :: chmess 3039 3040 if(.not.(llesread)) return 3041 3042 open (ilesfile,file='prof.inp.001',status='old',iostat=ierr) 3043 if (ierr /= 0) stop 'ERROR:Prof.inp does not exist' 3044 read (ilesfile,*) kmax 3045 do k=1,kmax 3046 read (ilesfile,*) height(k),pprof(k), tprof(k),thlprof(k), 3047 . qprof (k),uprof(k), vprof(k), wprof(k), 3048 . omega (k),o3mmr(k) 3049 enddo 3050 close(ilesfile) 3051 3052 return 3053 end 3054 3055 !====================================================================== 3056 subroutine readprofile_astex(nlev_max,kmax,height,pprof,tprof, 3057 . thlprof,qvprof,qlprof,qtprof,uprof,vprof,wprof,tkeprof,o3mmr) 3058 !====================================================================== 3059 implicit none 3060 3061 integer nlev_max,kmax,kmax2 3062 logical :: llesread = .true. 3063 3064 real height(nlev_max),pprof(nlev_max),tprof(nlev_max), 3065 . thlprof(nlev_max),qlprof(nlev_max),qtprof(nlev_max), 3066 . qvprof(nlev_max),uprof(nlev_max),vprof(nlev_max), 3067 . wprof(nlev_max),tkeprof(nlev_max),o3mmr(nlev_max) 3068 3069 integer, parameter :: ilesfile=1 3070 integer :: ierr,irad,imax,jtot,k 3071 logical :: lmoist,lcoriol,ltimedep 3072 real :: xsize,ysize 3073 real :: ustin,wsvsurf,timerad 3074 character(80) :: chmess 3075 3076 if(.not.(llesread)) return 3077 3078 open (ilesfile,file='prof.inp.001',status='old',iostat=ierr) 3079 if (ierr /= 0) stop 'ERROR:Prof.inp does not exist' 3080 read (ilesfile,*) kmax 3081 do k=1,kmax 3082 read (ilesfile,*) height(k),pprof(k), tprof(k),thlprof(k), 3083 . qvprof (k),qlprof (k),qtprof (k), 3084 . uprof(k), vprof(k), wprof(k),tkeprof(k),o3mmr(k) 3085 enddo 3086 close(ilesfile) 3087 3088 return 3089 end 3090 2481 3091 2482 3092 … … 2539 3149 return 2540 3150 end 2541 !=============================================================== 2542 function ismin(n,sx,incx) 3151 !===================================================================== 3152 subroutine read_amma(fich_amma,nlevel,ntime 3153 : ,zz,pp,temp,qv,u,v,dw 3154 : ,dt,dq,sens,flat) 3155 3156 !program reading forcings of the AMMA case study 3157 2543 3158 2544 3159 implicit none 2545 integer n,i,incx,ismin,ix 2546 real sx((n-1)*incx+1),sxmin 2547 2548 ix=1 2549 ismin=1 2550 sxmin=sx(1) 2551 do i=1,n-1 2552 ix=ix+incx 2553 if(sx(ix).lt.sxmin) then 2554 sxmin=sx(ix) 2555 ismin=i+1 2556 endif 2557 enddo 2558 2559 return 2560 end 2561 2562 !=============================================================== 2563 function ismax(n,sx,incx) 3160 3161 #include "netcdf.inc" 3162 3163 integer ntime,nlevel 3164 integer l,k 3165 character*80 :: fich_amma 3166 real*8 time(ntime) 3167 real*8 zz(nlevel) 3168 3169 real*8 temp(nlevel),pp(nlevel) 3170 real*8 qv(nlevel),u(nlevel) 3171 real*8 v(nlevel) 3172 real*8 dw(nlevel,ntime) 3173 real*8 dt(nlevel,ntime) 3174 real*8 dq(nlevel,ntime) 3175 real*8 flat(ntime),sens(ntime) 3176 3177 integer nid, ierr 3178 integer nbvar3d 3179 parameter(nbvar3d=30) 3180 integer var3didin(nbvar3d) 3181 3182 ierr = NF_OPEN(fich_amma,NF_NOWRITE,nid) 3183 if (ierr.NE.NF_NOERR) then 3184 write(*,*) 'ERROR: Pb opening forcings nc file ' 3185 write(*,*) NF_STRERROR(ierr) 3186 stop "" 3187 endif 3188 3189 3190 ierr=NF_INQ_VARID(nid,"zz",var3didin(1)) 3191 if(ierr/=NF_NOERR) then 3192 write(*,*) NF_STRERROR(ierr) 3193 stop 'lev' 3194 endif 3195 3196 3197 ierr=NF_INQ_VARID(nid,"temp",var3didin(2)) 3198 if(ierr/=NF_NOERR) then 3199 write(*,*) NF_STRERROR(ierr) 3200 stop 'temp' 3201 endif 3202 3203 ierr=NF_INQ_VARID(nid,"qv",var3didin(3)) 3204 if(ierr/=NF_NOERR) then 3205 write(*,*) NF_STRERROR(ierr) 3206 stop 'qv' 3207 endif 3208 3209 ierr=NF_INQ_VARID(nid,"u",var3didin(4)) 3210 if(ierr/=NF_NOERR) then 3211 write(*,*) NF_STRERROR(ierr) 3212 stop 'u' 3213 endif 3214 3215 ierr=NF_INQ_VARID(nid,"v",var3didin(5)) 3216 if(ierr/=NF_NOERR) then 3217 write(*,*) NF_STRERROR(ierr) 3218 stop 'v' 3219 endif 3220 3221 ierr=NF_INQ_VARID(nid,"dw",var3didin(6)) 3222 if(ierr/=NF_NOERR) then 3223 write(*,*) NF_STRERROR(ierr) 3224 stop 'dw' 3225 endif 3226 3227 ierr=NF_INQ_VARID(nid,"dt",var3didin(7)) 3228 if(ierr/=NF_NOERR) then 3229 write(*,*) NF_STRERROR(ierr) 3230 stop 'dt' 3231 endif 3232 3233 ierr=NF_INQ_VARID(nid,"dq",var3didin(8)) 3234 if(ierr/=NF_NOERR) then 3235 write(*,*) NF_STRERROR(ierr) 3236 stop 'dq' 3237 endif 3238 3239 ierr=NF_INQ_VARID(nid,"sens",var3didin(9)) 3240 if(ierr/=NF_NOERR) then 3241 write(*,*) NF_STRERROR(ierr) 3242 stop 'sens' 3243 endif 3244 3245 ierr=NF_INQ_VARID(nid,"flat",var3didin(10)) 3246 if(ierr/=NF_NOERR) then 3247 write(*,*) NF_STRERROR(ierr) 3248 stop 'flat' 3249 endif 3250 3251 ierr=NF_INQ_VARID(nid,"pp",var3didin(11)) 3252 if(ierr/=NF_NOERR) then 3253 write(*,*) NF_STRERROR(ierr) 3254 stop 'pp' 3255 endif 3256 3257 !dimensions lecture 3258 ! call catchaxis(nid,ntime,nlevel,time,z,ierr) 3259 3260 #ifdef NC_DOUBLE 3261 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(1),zz) 3262 #else 3263 ierr = NF_GET_VAR_REAL(nid,var3didin(1),zz) 3264 #endif 3265 if(ierr/=NF_NOERR) then 3266 write(*,*) NF_STRERROR(ierr) 3267 stop "getvarup" 3268 endif 3269 ! write(*,*)'lecture z ok',zz 3270 3271 #ifdef NC_DOUBLE 3272 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(2),temp) 3273 #else 3274 ierr = NF_GET_VAR_REAL(nid,var3didin(2),temp) 3275 #endif 3276 if(ierr/=NF_NOERR) then 3277 write(*,*) NF_STRERROR(ierr) 3278 stop "getvarup" 3279 endif 3280 ! write(*,*)'lecture th ok',temp 3281 3282 #ifdef NC_DOUBLE 3283 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(3),qv) 3284 #else 3285 ierr = NF_GET_VAR_REAL(nid,var3didin(3),qv) 3286 #endif 3287 if(ierr/=NF_NOERR) then 3288 write(*,*) NF_STRERROR(ierr) 3289 stop "getvarup" 3290 endif 3291 ! write(*,*)'lecture qv ok',qv 3292 3293 #ifdef NC_DOUBLE 3294 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(4),u) 3295 #else 3296 ierr = NF_GET_VAR_REAL(nid,var3didin(4),u) 3297 #endif 3298 if(ierr/=NF_NOERR) then 3299 write(*,*) NF_STRERROR(ierr) 3300 stop "getvarup" 3301 endif 3302 ! write(*,*)'lecture u ok',u 3303 3304 #ifdef NC_DOUBLE 3305 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(5),v) 3306 #else 3307 ierr = NF_GET_VAR_REAL(nid,var3didin(5),v) 3308 #endif 3309 if(ierr/=NF_NOERR) then 3310 write(*,*) NF_STRERROR(ierr) 3311 stop "getvarup" 3312 endif 3313 ! write(*,*)'lecture v ok',v 3314 3315 #ifdef NC_DOUBLE 3316 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(6),dw) 3317 #else 3318 ierr = NF_GET_VAR_REAL(nid,var3didin(6),dw) 3319 #endif 3320 if(ierr/=NF_NOERR) then 3321 write(*,*) NF_STRERROR(ierr) 3322 stop "getvarup" 3323 endif 3324 ! write(*,*)'lecture w ok',dw 3325 3326 #ifdef NC_DOUBLE 3327 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(7),dt) 3328 #else 3329 ierr = NF_GET_VAR_REAL(nid,var3didin(7),dt) 3330 #endif 3331 if(ierr/=NF_NOERR) then 3332 write(*,*) NF_STRERROR(ierr) 3333 stop "getvarup" 3334 endif 3335 ! write(*,*)'lecture dt ok',dt 3336 3337 #ifdef NC_DOUBLE 3338 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(8),dq) 3339 #else 3340 ierr = NF_GET_VAR_REAL(nid,var3didin(8),dq) 3341 #endif 3342 if(ierr/=NF_NOERR) then 3343 write(*,*) NF_STRERROR(ierr) 3344 stop "getvarup" 3345 endif 3346 ! write(*,*)'lecture dq ok',dq 3347 3348 #ifdef NC_DOUBLE 3349 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(9),sens) 3350 #else 3351 ierr = NF_GET_VAR_REAL(nid,var3didin(9),sens) 3352 #endif 3353 if(ierr/=NF_NOERR) then 3354 write(*,*) NF_STRERROR(ierr) 3355 stop "getvarup" 3356 endif 3357 ! write(*,*)'lecture sens ok',sens 3358 3359 #ifdef NC_DOUBLE 3360 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(10),flat) 3361 #else 3362 ierr = NF_GET_VAR_REAL(nid,var3didin(10),flat) 3363 #endif 3364 if(ierr/=NF_NOERR) then 3365 write(*,*) NF_STRERROR(ierr) 3366 stop "getvarup" 3367 endif 3368 ! write(*,*)'lecture flat ok',flat 3369 3370 #ifdef NC_DOUBLE 3371 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(11),pp) 3372 #else 3373 ierr = NF_GET_VAR_REAL(nid,var3didin(11),pp) 3374 #endif 3375 if(ierr/=NF_NOERR) then 3376 write(*,*) NF_STRERROR(ierr) 3377 stop "getvarup" 3378 endif 3379 ! write(*,*)'lecture pp ok',pp 3380 3381 return 3382 end subroutine read_amma 3383 !====================================================================== 3384 SUBROUTINE interp_amma_time(day,day1,annee_ref 3385 i ,year_ini_amma,day_ini_amma,nt_amma,dt_amma,nlev_amma 3386 i ,vitw_amma,ht_amma,hq_amma,lat_amma,sens_amma 3387 o ,vitw_prof,ht_prof,hq_prof,lat_prof,sens_prof) 3388 implicit none 3389 3390 !--------------------------------------------------------------------------------------- 3391 ! Time interpolation of a 2D field to the timestep corresponding to day 3392 ! 3393 ! day: current julian day (e.g. 717538.2) 3394 ! day1: first day of the simulation 3395 ! nt_amma: total nb of data in the forcing (e.g. 48 for AMMA) 3396 ! dt_amma: total time interval (in sec) between 2 forcing data (e.g. 30min for AMMA) 3397 !--------------------------------------------------------------------------------------- 3398 3399 #include "compar1d.h" 3400 3401 ! inputs: 3402 integer annee_ref 3403 integer nt_amma,nlev_amma 3404 integer year_ini_amma 3405 real day, day1,day_ini_amma,dt_amma 3406 real vitw_amma(nlev_amma,nt_amma) 3407 real ht_amma(nlev_amma,nt_amma) 3408 real hq_amma(nlev_amma,nt_amma) 3409 real lat_amma(nt_amma) 3410 real sens_amma(nt_amma) 3411 ! outputs: 3412 real vitw_prof(nlev_amma) 3413 real ht_prof(nlev_amma) 3414 real hq_prof(nlev_amma) 3415 real lat_prof,sens_prof 3416 ! local: 3417 integer it_amma1, it_amma2,k 3418 real timeit,time_amma1,time_amma2,frac 3419 3420 3421 if (forcing_type.eq.6) then 3422 ! Check that initial day of the simulation consistent with AMMA case: 3423 if (annee_ref.ne.2006) then 3424 print*,'Pour AMMA, annee_ref doit etre 2006' 3425 print*,'Changer annee_ref dans run.def' 3426 stop 3427 endif 3428 if (annee_ref.eq.2006 .and. day1.lt.day_ini_amma) then 3429 print*,'AMMA a débuté le 10 juillet 2006',day1,day_ini_amma 3430 print*,'Changer dayref dans run.def' 3431 stop 3432 endif 3433 if (annee_ref.eq.2006 .and. day1.gt.day_ini_amma+1) then 3434 print*,'AMMA a fini le 11 juillet' 3435 print*,'Changer dayref ou nday dans run.def' 3436 stop 3437 endif 3438 endif 3439 3440 ! Determine timestep relative to the 1st day of AMMA: 3441 ! timeit=(day-day1)*86400. 3442 ! if (annee_ref.eq.1992) then 3443 ! timeit=(day-day_ini_toga)*86400. 3444 ! else 3445 ! timeit=(day+61.-1.)*86400. ! 61 days between Nov01 and Dec31 1992 3446 ! endif 3447 timeit=(day-day_ini_amma)*86400 3448 3449 ! Determine the closest observation times: 3450 ! it_amma1=INT(timeit/dt_amma)+1 3451 ! it_amma2=it_amma1 + 1 3452 ! time_amma1=(it_amma1-1)*dt_amma 3453 ! time_amma2=(it_amma2-1)*dt_amma 3454 3455 it_amma1=INT(timeit/dt_amma)+1 3456 IF (it_amma1 .EQ. nt_amma) THEN 3457 it_amma2=it_amma1 3458 ELSE 3459 it_amma2=it_amma1 + 1 3460 ENDIF 3461 time_amma1=(it_amma1-1)*dt_amma 3462 time_amma2=(it_amma2-1)*dt_amma 3463 3464 if (it_amma1 .gt. nt_amma) then 3465 write(*,*) 'PB-stop: day, it_amma1, it_amma2, timeit: ' 3466 : ,day,day_ini_amma,it_amma1,it_amma2,timeit/86400. 3467 stop 3468 endif 3469 3470 ! time interpolation: 3471 frac=(time_amma2-timeit)/(time_amma2-time_amma1) 3472 frac=max(frac,0.0) 3473 3474 lat_prof = lat_amma(it_amma2) 3475 : -frac*(lat_amma(it_amma2)-lat_amma(it_amma1)) 3476 sens_prof = sens_amma(it_amma2) 3477 : -frac*(sens_amma(it_amma2)-sens_amma(it_amma1)) 3478 3479 do k=1,nlev_amma 3480 vitw_prof(k) = vitw_amma(k,it_amma2) 3481 : -frac*(vitw_amma(k,it_amma2)-vitw_amma(k,it_amma1)) 3482 ht_prof(k) = ht_amma(k,it_amma2) 3483 : -frac*(ht_amma(k,it_amma2)-ht_amma(k,it_amma1)) 3484 hq_prof(k) = hq_amma(k,it_amma2) 3485 : -frac*(hq_amma(k,it_amma2)-hq_amma(k,it_amma1)) 3486 enddo 3487 3488 return 3489 END 3490 3491 !===================================================================== 3492 subroutine read_fire(fich_fire,nlevel,ntime 3493 : ,zz,thl,qt,u,v,tke 3494 : ,ug,vg,wls,dqtdx,dqtdy,dqtdt,thl_rad) 3495 3496 !program reading forcings of the FIRE case study 3497 2564 3498 2565 3499 implicit none 2566 integer n,i,incx,ismax,ix 2567 real sx((n-1)*incx+1),sxmax 2568 2569 ix=1 2570 ismax=1 2571 sxmax=sx(1) 2572 do i=1,n-1 2573 ix=ix+incx 2574 if(sx(ix).gt.sxmax) then 2575 sxmax=sx(ix) 2576 ismax=i+1 2577 endif 2578 enddo 2579 2580 return 2581 end 2582 3500 3501 #include "netcdf.inc" 3502 3503 integer ntime,nlevel 3504 integer l,k 3505 character*80 :: fich_fire 3506 real*8 time(ntime) 3507 real*8 zz(nlevel) 3508 3509 real*8 thl(nlevel) 3510 real*8 qt(nlevel),u(nlevel) 3511 real*8 v(nlevel),tke(nlevel) 3512 real*8 ug(nlevel,ntime),vg(nlevel,ntime),wls(nlevel,ntime) 3513 real*8 dqtdx(nlevel,ntime),dqtdy(nlevel,ntime) 3514 real*8 dqtdt(nlevel,ntime),thl_rad(nlevel,ntime) 3515 3516 integer nid, ierr 3517 integer nbvar3d 3518 parameter(nbvar3d=30) 3519 integer var3didin(nbvar3d) 3520 3521 ierr = NF_OPEN(fich_fire,NF_NOWRITE,nid) 3522 if (ierr.NE.NF_NOERR) then 3523 write(*,*) 'ERROR: Pb opening forcings nc file ' 3524 write(*,*) NF_STRERROR(ierr) 3525 stop "" 3526 endif 3527 3528 3529 ierr=NF_INQ_VARID(nid,"zz",var3didin(1)) 3530 if(ierr/=NF_NOERR) then 3531 write(*,*) NF_STRERROR(ierr) 3532 stop 'lev' 3533 endif 3534 3535 3536 ierr=NF_INQ_VARID(nid,"thetal",var3didin(2)) 3537 if(ierr/=NF_NOERR) then 3538 write(*,*) NF_STRERROR(ierr) 3539 stop 'temp' 3540 endif 3541 3542 ierr=NF_INQ_VARID(nid,"qt",var3didin(3)) 3543 if(ierr/=NF_NOERR) then 3544 write(*,*) NF_STRERROR(ierr) 3545 stop 'qv' 3546 endif 3547 3548 ierr=NF_INQ_VARID(nid,"u",var3didin(4)) 3549 if(ierr/=NF_NOERR) then 3550 write(*,*) NF_STRERROR(ierr) 3551 stop 'u' 3552 endif 3553 3554 ierr=NF_INQ_VARID(nid,"v",var3didin(5)) 3555 if(ierr/=NF_NOERR) then 3556 write(*,*) NF_STRERROR(ierr) 3557 stop 'v' 3558 endif 3559 3560 ierr=NF_INQ_VARID(nid,"tke",var3didin(6)) 3561 if(ierr/=NF_NOERR) then 3562 write(*,*) NF_STRERROR(ierr) 3563 stop 'tke' 3564 endif 3565 3566 ierr=NF_INQ_VARID(nid,"ugeo",var3didin(7)) 3567 if(ierr/=NF_NOERR) then 3568 write(*,*) NF_STRERROR(ierr) 3569 stop 'ug' 3570 endif 3571 3572 ierr=NF_INQ_VARID(nid,"vgeo",var3didin(8)) 3573 if(ierr/=NF_NOERR) then 3574 write(*,*) NF_STRERROR(ierr) 3575 stop 'vg' 3576 endif 3577 3578 ierr=NF_INQ_VARID(nid,"wls",var3didin(9)) 3579 if(ierr/=NF_NOERR) then 3580 write(*,*) NF_STRERROR(ierr) 3581 stop 'wls' 3582 endif 3583 3584 ierr=NF_INQ_VARID(nid,"dqtdx",var3didin(10)) 3585 if(ierr/=NF_NOERR) then 3586 write(*,*) NF_STRERROR(ierr) 3587 stop 'dqtdx' 3588 endif 3589 3590 ierr=NF_INQ_VARID(nid,"dqtdy",var3didin(11)) 3591 if(ierr/=NF_NOERR) then 3592 write(*,*) NF_STRERROR(ierr) 3593 stop 'dqtdy' 3594 endif 3595 3596 ierr=NF_INQ_VARID(nid,"dqtdt",var3didin(12)) 3597 if(ierr/=NF_NOERR) then 3598 write(*,*) NF_STRERROR(ierr) 3599 stop 'dqtdt' 3600 endif 3601 3602 ierr=NF_INQ_VARID(nid,"thl_rad",var3didin(13)) 3603 if(ierr/=NF_NOERR) then 3604 write(*,*) NF_STRERROR(ierr) 3605 stop 'thl_rad' 3606 endif 3607 !dimensions lecture 3608 ! call catchaxis(nid,ntime,nlevel,time,z,ierr) 3609 3610 #ifdef NC_DOUBLE 3611 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(1),zz) 3612 #else 3613 ierr = NF_GET_VAR_REAL(nid,var3didin(1),zz) 3614 #endif 3615 if(ierr/=NF_NOERR) then 3616 write(*,*) NF_STRERROR(ierr) 3617 stop "getvarup" 3618 endif 3619 ! write(*,*)'lecture z ok',zz 3620 3621 #ifdef NC_DOUBLE 3622 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(2),thl) 3623 #else 3624 ierr = NF_GET_VAR_REAL(nid,var3didin(2),thl) 3625 #endif 3626 if(ierr/=NF_NOERR) then 3627 write(*,*) NF_STRERROR(ierr) 3628 stop "getvarup" 3629 endif 3630 ! write(*,*)'lecture thl ok',thl 3631 3632 #ifdef NC_DOUBLE 3633 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(3),qt) 3634 #else 3635 ierr = NF_GET_VAR_REAL(nid,var3didin(3),qt) 3636 #endif 3637 if(ierr/=NF_NOERR) then 3638 write(*,*) NF_STRERROR(ierr) 3639 stop "getvarup" 3640 endif 3641 ! write(*,*)'lecture qt ok',qt 3642 3643 #ifdef NC_DOUBLE 3644 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(4),u) 3645 #else 3646 ierr = NF_GET_VAR_REAL(nid,var3didin(4),u) 3647 #endif 3648 if(ierr/=NF_NOERR) then 3649 write(*,*) NF_STRERROR(ierr) 3650 stop "getvarup" 3651 endif 3652 ! write(*,*)'lecture u ok',u 3653 3654 #ifdef NC_DOUBLE 3655 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(5),v) 3656 #else 3657 ierr = NF_GET_VAR_REAL(nid,var3didin(5),v) 3658 #endif 3659 if(ierr/=NF_NOERR) then 3660 write(*,*) NF_STRERROR(ierr) 3661 stop "getvarup" 3662 endif 3663 ! write(*,*)'lecture v ok',v 3664 3665 #ifdef NC_DOUBLE 3666 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(6),tke) 3667 #else 3668 ierr = NF_GET_VAR_REAL(nid,var3didin(6),tke) 3669 #endif 3670 if(ierr/=NF_NOERR) then 3671 write(*,*) NF_STRERROR(ierr) 3672 stop "getvarup" 3673 endif 3674 ! write(*,*)'lecture tke ok',tke 3675 3676 #ifdef NC_DOUBLE 3677 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(7),ug) 3678 #else 3679 ierr = NF_GET_VAR_REAL(nid,var3didin(7),ug) 3680 #endif 3681 if(ierr/=NF_NOERR) then 3682 write(*,*) NF_STRERROR(ierr) 3683 stop "getvarup" 3684 endif 3685 ! write(*,*)'lecture ug ok',ug 3686 3687 #ifdef NC_DOUBLE 3688 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(8),vg) 3689 #else 3690 ierr = NF_GET_VAR_REAL(nid,var3didin(8),vg) 3691 #endif 3692 if(ierr/=NF_NOERR) then 3693 write(*,*) NF_STRERROR(ierr) 3694 stop "getvarup" 3695 endif 3696 ! write(*,*)'lecture vg ok',vg 3697 3698 #ifdef NC_DOUBLE 3699 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(9),wls) 3700 #else 3701 ierr = NF_GET_VAR_REAL(nid,var3didin(9),wls) 3702 #endif 3703 if(ierr/=NF_NOERR) then 3704 write(*,*) NF_STRERROR(ierr) 3705 stop "getvarup" 3706 endif 3707 ! write(*,*)'lecture wls ok',wls 3708 3709 #ifdef NC_DOUBLE 3710 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(10),dqtdx) 3711 #else 3712 ierr = NF_GET_VAR_REAL(nid,var3didin(10),dqtdx) 3713 #endif 3714 if(ierr/=NF_NOERR) then 3715 write(*,*) NF_STRERROR(ierr) 3716 stop "getvarup" 3717 endif 3718 ! write(*,*)'lecture dqtdx ok',dqtdx 3719 3720 #ifdef NC_DOUBLE 3721 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(11),dqtdy) 3722 #else 3723 ierr = NF_GET_VAR_REAL(nid,var3didin(11),dqtdy) 3724 #endif 3725 if(ierr/=NF_NOERR) then 3726 write(*,*) NF_STRERROR(ierr) 3727 stop "getvarup" 3728 endif 3729 ! write(*,*)'lecture dqtdy ok',dqtdy 3730 3731 #ifdef NC_DOUBLE 3732 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(12),dqtdt) 3733 #else 3734 ierr = NF_GET_VAR_REAL(nid,var3didin(12),dqtdt) 3735 #endif 3736 if(ierr/=NF_NOERR) then 3737 write(*,*) NF_STRERROR(ierr) 3738 stop "getvarup" 3739 endif 3740 ! write(*,*)'lecture dqtdt ok',dqtdt 3741 3742 #ifdef NC_DOUBLE 3743 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(13),thl_rad) 3744 #else 3745 ierr = NF_GET_VAR_REAL(nid,var3didin(13),thl_rad) 3746 #endif 3747 if(ierr/=NF_NOERR) then 3748 write(*,*) NF_STRERROR(ierr) 3749 stop "getvarup" 3750 endif 3751 ! write(*,*)'lecture thl_rad ok',thl_rad 3752 3753 return 3754 end subroutine read_fire -
LMDZ5/branches/testing/libf/phy1d/1DUTILS.h_with_writelim
r1707 r1795 125 125 ok_flux_surf = .FALSE. 126 126 CALL getin('ok_flux_surf',ok_flux_surf) 127 128 !Config Key = ok_old_disvert 129 !Config Desc = utilisation de l ancien programme disvert0 (dans 1DUTILS.h) 130 !Config Def = false 131 !Config Help = utilisation de l ancien programme disvert0 (dans 1DUTILS.h) 132 ok_old_disvert = .FALSE. 133 CALL getin('ok_old_disvert',ok_old_disvert) 127 134 128 135 !Config Key = time_ini … … 703 710 RETURN 704 711 END 705 subroutine scopy(n,sx,incx,sy,incy)706 !707 IMPLICIT NONE708 !709 integer n,incx,incy,ix,iy,i710 real sx((n-1)*incx+1),sy((n-1)*incy+1)711 !712 iy=1713 ix=1714 do 10 i=1,n715 sy(iy)=sx(ix)716 ix=ix+incx717 iy=iy+incy718 10 continue719 !720 return721 end722 712 subroutine wrgradsfi(if,nl,field,name,titlevar) 723 713 implicit none … … 1079 1069 1080 1070 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1081 SUBROUTINE disvert (pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig)1071 SUBROUTINE disvert0(pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig) 1082 1072 1083 1073 ! Auteur : P. Le Van . … … 2662 2652 return 2663 2653 end 2664 !=============================================================== 2665 function ismin(n,sx,incx) 2666 2667 implicit none 2668 integer n,i,incx,ismin,ix 2669 real sx((n-1)*incx+1),sxmin 2670 2671 ix=1 2672 ismin=1 2673 sxmin=sx(1) 2674 do i=1,n-1 2675 ix=ix+incx 2676 if(sx(ix).lt.sxmin) then 2677 sxmin=sx(ix) 2678 ismin=i+1 2679 endif 2680 enddo 2681 2682 return 2683 end 2684 2685 !=============================================================== 2686 function ismax(n,sx,incx) 2687 2688 implicit none 2689 integer n,i,incx,ismax,ix 2690 real sx((n-1)*incx+1),sxmax 2691 2692 ix=1 2693 ismax=1 2694 sxmax=sx(1) 2695 do i=1,n-1 2696 ix=ix+incx 2697 if(sx(ix).gt.sxmax) then 2698 sxmax=sx(ix) 2699 ismax=i+1 2700 endif 2701 enddo 2702 2703 return 2704 end 2705 2654 -
LMDZ5/branches/testing/libf/phy1d/1DUTILS.h_with_writelim_old
r1707 r1795 125 125 ok_flux_surf = .FALSE. 126 126 CALL getin('ok_flux_surf',ok_flux_surf) 127 128 !Config Key = ok_old_disvert 129 !Config Desc = utilisation de l ancien programme disvert0 (dans 1DUTILS.h) 130 !Config Def = false 131 !Config Help = utilisation de l ancien programme disvert0 (dans 1DUTILS.h) 132 ok_old_disvert = .FALSE. 133 CALL getin('ok_old_disvert',ok_old_disvert) 127 134 128 135 !Config Key = time_ini … … 703 710 RETURN 704 711 END 705 subroutine scopy(n,sx,incx,sy,incy)706 !707 IMPLICIT NONE708 !709 integer n,incx,incy,ix,iy,i710 real sx((n-1)*incx+1),sy((n-1)*incy+1)711 !712 iy=1713 ix=1714 do 10 i=1,n715 sy(iy)=sx(ix)716 ix=ix+incx717 iy=iy+incy718 10 continue719 !720 return721 end722 712 subroutine wrgradsfi(if,nl,field,name,titlevar) 723 713 implicit none … … 1079 1069 1080 1070 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1081 SUBROUTINE disvert (pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig)1071 SUBROUTINE disvert0(pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig) 1082 1072 1083 1073 ! Auteur : P. Le Van . … … 2604 2594 end 2605 2595 2606 !=============================================================== 2607 function ismin(n,sx,incx) 2608 2609 implicit none 2610 integer n,i,incx,ismin,ix 2611 real sx((n-1)*incx+1),sxmin 2612 2613 ix=1 2614 ismin=1 2615 sxmin=sx(1) 2616 do i=1,n-1 2617 ix=ix+incx 2618 if(sx(ix).lt.sxmin) then 2619 sxmin=sx(ix) 2620 ismin=i+1 2621 endif 2622 enddo 2623 2624 return 2625 end 2626 2627 !=============================================================== 2628 function ismax(n,sx,incx) 2629 2630 implicit none 2631 integer n,i,incx,ismax,ix 2632 real sx((n-1)*incx+1),sxmax 2633 2634 ix=1 2635 ismax=1 2636 sxmax=sx(1) 2637 do i=1,n-1 2638 ix=ix+incx 2639 if(sx(ix).gt.sxmax) then 2640 sxmax=sx(ix) 2641 ismax=i+1 2642 endif 2643 enddo 2644 2645 return 2646 end 2647 2596 -
LMDZ5/branches/testing/libf/phy1d/1D_decl_cases.h
r1665 r1795 81 81 real ht_proftwp(nlev_twpi),vt_proftwp(nlev_twpi) 82 82 real hq_proftwp(nlev_twpi),vq_proftwp(nlev_twpi) 83 84 85 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 86 !Declarations specifiques au cas AMMA 87 character*80 :: fich_amma 88 ! Option du cas AMMA ou on impose la discretisation verticale (Ap,Bp) 89 logical :: fixe_disvert=.true. 90 integer nlev_amma, nt_amma 91 ! parameter (nlev_amma=29, nt_amma=48) ! Fleur, juillet 2012 92 parameter (nlev_amma=36, nt_amma=48) ! Romain, octobre 2012 93 ! parameter (nlev_amma=26, nt_amma=48) ! Test MPL feverier 2013 94 integer year_ini_amma, day_ini_amma, mth_ini_amma 95 real heure_ini_amma 96 real day_ju_ini_amma ! Julian day of amma first day 97 parameter (year_ini_amma=2006) 98 parameter (mth_ini_amma=7) 99 parameter (day_ini_amma=10) ! 10 = 10Juil2006 100 parameter (heure_ini_amma=0.) !0h en secondes 101 real dt_amma 102 parameter (dt_amma=1800.) 103 104 !profils initiaux: 105 real plev_amma(nlev_amma) 106 real tv_amma(nlev_amma),rho_amma(nlev_amma) 107 real thv_amma(nlev_amma) 108 109 real z_amma(nlev_amma) 110 real th_amma(nlev_amma),q_amma(nlev_amma) 111 real u_amma(nlev_amma) 112 real v_amma(nlev_amma) 113 114 real thvsurf_amma,tvsurf_amma,rhosurf_amma,thsurf 115 116 real th_ammai(nlev_amma),q_ammai(nlev_amma) 117 real u_ammai(nlev_amma) 118 real v_ammai(nlev_amma) 119 real vitw_ammai(nlev_amma) 120 real ht_ammai(nlev_amma) 121 real hq_ammai(nlev_amma) 122 real vt_ammai(nlev_amma) 123 real vq_ammai(nlev_amma) 124 125 !forcings 126 real ht_amma(nlev_amma,nt_amma) 127 real hq_amma(nlev_amma,nt_amma) 128 real vitw_amma(nlev_amma,nt_amma) 129 real lat_amma(nt_amma),sens_amma(nt_amma) 130 131 !champs interpoles 132 real plev_profamma(nlev_amma),vitw_profamma(nlev_amma) 133 real ht_profamma(nlev_amma) 134 real hq_profamma(nlev_amma) 135 real lat_profamma,sens_profamma 136 real vt_profamma(nlev_amma) 137 real vq_profamma(nlev_amma) 138 real th_profamma(nlev_amma) 139 real q_profamma(nlev_amma) 140 real u_profamma(nlev_amma) 141 real v_profamma(nlev_amma) 142 143 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 144 !Declarations specifiques au cas FIRE 145 character*80 :: fich_fire 146 integer nlev_fire, nt_fire 147 parameter (nlev_fire=120, nt_fire=1) 148 integer year_ini_fire, day_ini_fire, mth_ini_fire 149 real heure_ini_fire 150 real day_ju_ini_fire ! Julian day of fire first day 151 parameter (year_ini_fire=1987) 152 parameter (mth_ini_fire=7) 153 parameter (day_ini_fire=14) ! 14 = 14Juil1987 154 parameter (heure_ini_fire=0.) !0h en secondes 155 156 !profils initiaux: 157 real z_fire(nlev_fire) 158 real thl_fire(nlev_fire),qt_fire(nlev_fire) 159 real u_fire(nlev_fire), v_fire(nlev_fire) 160 real tke_fire(nlev_fire) 161 162 !forcings 163 real ugeo_fire(nlev_fire),vgeo_fire(nlev_fire) 164 real wls_fire(nlev_fire),dqtdx_fire(nlev_fire) 165 real dqtdy_fire(nlev_fire) 166 real dqtdt_fire(nlev_fire),thl_rad_fire(nlev_fire) 167 168 real ugeo_mod(llm),vgeo_mod(llm),wls_mod(llm) 169 real dqtdx_mod(llm),dqtdy_mod(llm),dqtdt_mod(llm) 170 real thl_rad_mod(llm) 83 171 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 84 172 ! Declarations specifiques au cas GCSSold … … 127 215 real sens_prof,flat_prof,fact 128 216 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 129 217 ! declarations specifiques au cas Sandu 218 character*80 :: fich_sandu 219 ! integer nlev_prof 220 ! parameter (nlev_prof = 41) 221 integer nlev_sandu, nt_sandu 222 parameter (nlev_sandu=87, nt_sandu=13) 223 integer year_ini_sandu, day_ini_sandu, mth_ini_sandu 224 real day_ju_ini_sandu ! Julian day of sandu case first day 225 parameter (year_ini_sandu=2006) 226 parameter (mth_ini_sandu=7) 227 parameter (day_ini_sandu=15) ! 196 = 15 juillet 2006 228 real dt_sandu, tau_sandu 229 logical :: trouve_700=.true. 230 parameter (dt_sandu=6.*3600.) ! forcages donnes ttes les 6 heures par ifa_sandu.txt 231 ! parameter (tau_sandu=3600.) ! temps de relaxation u,v,thetal,qt vers profil init et au dessus 700hPa 232 !! 233 integer it_sandu1, it_sandu2 234 real time_sandu1,time_sandu2 235 236 real ts_sandu(nt_sandu) 237 ! profs comme "profil sandu" 238 real plev_profs(nlev_sandu) 239 real t_profs(nlev_sandu),thl_profs(nlev_sandu) 240 real q_profs(nlev_sandu) 241 real u_profs(nlev_sandu),v_profs(nlev_sandu),w_profs(nlev_sandu) 242 real omega_profs(nlev_sandu),o3mmr_profs(nlev_sandu) 243 244 real thl_mod(llm),omega_mod(llm),o3mmr_mod(llm),tke_mod(llm) 245 ! pour relaxer u,v,thl et qt vers les profils initiaux au dessus de 700hPa 246 real relax_u(llm),relax_v(llm),relax_thl(llm),relax_q(llm,2) 247 !vertical advection computation 248 real d_t_z(llm), d_q_z(llm) 249 real d_t_dyn_z(llm), d_q_dyn_z(llm) 250 real zz(llm) 251 real zfact 252 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 253 ! Declarations specifiques au cas Astex 254 character*80 :: fich_astex 255 integer nlev_astex, nt_astex 256 parameter (nlev_astex=34, nt_astex=49) 257 integer year_ini_astex, day_ini_astex, mth_ini_astex 258 real day_ju_ini_astex ! Julian day of astex case first day 259 parameter (year_ini_astex=1992) 260 parameter (mth_ini_astex=6) 261 parameter (day_ini_astex=13) ! 165 = 13 juin 1992 262 real dt_astex, tau_astex 263 parameter (dt_astex=3600.) ! forcages donnes ttes les heures par ifa_astex.txt 264 integer it_astex1, it_astex2 265 real time_astex1,time_astex2 266 real ts_astex(nt_astex),div_astex(nt_astex),ug_astex(nt_astex) 267 real vg_astex(nt_astex),ufa_astex(nt_astex),vfa_astex(nt_astex) 268 real div_prof,ug_prof,vg_prof,ufa_prof,vfa_prof 269 ! profa comme "profil astex" 270 real plev_profa(nlev_astex) 271 real t_profa(nlev_astex),thl_profa(nlev_astex) 272 real qv_profa(nlev_astex),ql_profa(nlev_astex) 273 real qt_profa(nlev_astex),o3mmr_profa(nlev_astex) 274 real u_profa(nlev_astex),v_profa(nlev_astex),w_profa(nlev_astex) 275 real tke_profa(nlev_astex) 276 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 277 -
LMDZ5/branches/testing/libf/phy1d/1D_interp_cases.h
r1665 r1795 181 181 182 182 endif ! forcing_twpice 183 184 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 185 !--------------------------------------------------------------------- 186 ! Interpolation forcing AMMA 187 !--------------------------------------------------------------------- 188 189 if (forcing_amma) then 190 191 print*, 192 : '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_amma=', 193 : daytime,day1,(daytime-day1)*86400., 194 : (daytime-day1)*86400/dt_amma 195 196 ! time interpolation using TOGA interpolation routine 197 CALL interp_amma_time(daytime,day1,annee_ref 198 i ,year_ini_amma,day_ju_ini_amma,nt_amma,dt_amma,nlev_amma 199 i ,vitw_amma,ht_amma,hq_amma,lat_amma,sens_amma 200 o ,vitw_profamma,ht_profamma,hq_profamma,lat_profamma 201 : ,sens_profamma) 202 203 print*,'apres interpolation temporelle AMMA' 204 205 do k=1,nlev_amma 206 th_profamma(k)=0. 207 q_profamma(k)=0. 208 u_profamma(k)=0. 209 v_profamma(k)=0. 210 vt_profamma(k)=0. 211 vq_profamma(k)=0. 212 enddo 213 ! vertical interpolation using TOGA interpolation routine: 214 ! write(*,*)'avant interp vert', t_proftwp 215 CALL interp_toga_vertical(play,nlev_amma,plev_amma 216 : ,th_profamma,q_profamma,u_profamma,v_profamma 217 : ,vitw_profamma 218 : ,ht_profamma,vt_profamma,hq_profamma,vq_profamma 219 : ,t_mod,q_mod,u_mod,v_mod,w_mod 220 : ,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc) 221 write(*,*) 'Profil initial forcing AMMA interpole' 222 223 224 !calcul de l'advection verticale a partir du omega 225 cCalcul des gradients verticaux 226 cinitialisation 227 do l=1,llm 228 d_t_z(l)=0. 229 d_q_z(l)=0. 230 enddo 231 232 DO l=2,llm-1 233 d_t_z(l)=(temp(l+1)-temp(l-1)) 234 & /(play(l+1)-play(l-1)) 235 d_q_z(l)=(q(l+1,1)-q(l-1,1)) 236 & /(play(l+1)-play(l-1)) 237 ENDDO 238 d_t_z(1)=d_t_z(2) 239 d_q_z(1)=d_q_z(2) 240 d_t_z(llm)=d_t_z(llm-1) 241 d_q_z(llm)=d_q_z(llm-1) 242 243 244 do l = 1, llm 245 rho(l) = play(l)/(rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))) 246 omega(l) = w_mod(l)*(-rg*rho(l)) 247 omega2(l)= omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq 248 alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) 249 !calcul de l'advection totale 250 ! d_th_adv(l) = alpha*omega(l)/rcpd+ht_mod(l)-omega(l)*d_t_z(l) 251 !attention: on impose dth 252 d_th_adv(l) = alpha*omega(l)/rcpd+ 253 & ht_mod(l)*(play(l)/pzero)**rkappa-omega(l)*d_t_z(l) 254 ! d_th_adv(l) = 0. 255 ! print*,'temp vert adv',l,ht_mod(l),vt_mod(l),-d_t_dyn_z(l) 256 d_q_adv(l,1) = hq_mod(l)-omega(l)*d_q_z(l) 257 ! d_q_adv(l,1) = 0. 258 ! print*,'q vert adv',l,hq_mod(l),vq_mod(l),-d_q_dyn_z(l) 259 260 dt_cooling(l) = 0.0 261 enddo 262 263 264 ! ok_flux_surf=.false. 265 fsens=-1.*sens_profamma 266 flat=-1.*lat_profamma 267 268 endif ! forcing_amma 269 183 270 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 184 271 !--------------------------------------------------------------------- … … 254 341 endif ! forcing_armcu 255 342 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 256 343 !--------------------------------------------------------------------- 344 ! Interpolation forcing in time and onto model levels 345 !--------------------------------------------------------------------- 346 if (forcing_sandu) then 347 348 print*, 349 : '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_sandu=', 350 : day,day1,(day-day1)*86400.,(day-day1)*86400/dt_sandu 351 352 ! time interpolation: 353 ! ATTENTION, cet appel ne convient pas pour TOGA !! 354 ! revoir 1DUTILS.h et les arguments 355 CALL interp_sandu_time(daytime,day1,annee_ref 356 i ,year_ini_sandu,day_ju_ini_sandu,nt_sandu,dt_sandu 357 i ,nlev_sandu 358 i ,ts_sandu,ts_prof) 359 360 if (type_ts_forcing.eq.1) ts_cur = ts_prof ! SST used in read_tsurf1d 361 362 ! vertical interpolation: 363 CALL interp_sandu_vertical(play,nlev_sandu,plev_profs 364 : ,t_profs,thl_profs,q_profs,u_profs,v_profs,w_profs 365 : ,omega_profs,o3mmr_profs 366 : ,t_mod,thl_mod,q_mod,u_mod,v_mod,w_mod 367 : ,omega_mod,o3mmr_mod,mxcalc) 368 !calcul de l'advection verticale 369 cCalcul des gradients verticaux 370 cinitialisation 371 d_t_z(:)=0. 372 d_q_z(:)=0. 373 d_t_dyn_z(:)=0. 374 d_q_dyn_z(:)=0. 375 ! schema centre 376 ! DO l=2,llm-1 377 ! d_t_z(l)=(temp(l+1)-temp(l-1)) 378 ! & /(play(l+1)-play(l-1)) 379 ! d_q_z(l)=(q(l+1,1)-q(l-1,1)) 380 ! & /(play(l+1)-play(l-1)) 381 ! schema amont 382 DO l=2,llm-1 383 d_t_z(l)=(temp(l+1)-temp(l))/(play(l+1)-play(l)) 384 d_q_z(l)=(q(l+1,1)-q(l,1))/(play(l+1)-play(l)) 385 ! print *,'l temp2 temp0 play2 play0 omega_mod', 386 ! & temp(l+1),temp(l-1),play(l+1),play(l-1),omega_mod(l) 387 ENDDO 388 d_t_z(1)=d_t_z(2) 389 d_q_z(1)=d_q_z(2) 390 d_t_z(llm)=d_t_z(llm-1) 391 d_q_z(llm)=d_q_z(llm-1) 392 393 ! calcul de l advection verticale 394 ! Confusion w (m/s) et omega (Pa/s) !! 395 d_t_dyn_z(:)=omega_mod(:)*d_t_z(:) 396 d_q_dyn_z(:)=omega_mod(:)*d_q_z(:) 397 ! do l=1,llm 398 ! print *,'d_t_dyn omega_mod d_t_z d_q_dyn d_q_z', 399 ! :l,d_t_dyn_z(l),omega_mod(l),d_t_z(l),d_q_dyn_z(l),d_q_z(l) 400 ! enddo 401 402 403 ! large-scale forcing : pour le cas Sandu ces forcages sont la SST 404 ! et une divergence constante -> profil de omega 405 tsurf = ts_prof 406 write(*,*) 'SST suivante: ',tsurf 407 do l = 1, llm 408 omega(l) = omega_mod(l) 409 omega2(l)= omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq 410 411 alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) 412 ! 413 ! d_th_adv(l) = 0.0 414 ! d_q_adv(l,1) = 0.0 415 !CR:test advection=0 416 !calcul de l'advection verticale 417 d_th_adv(l) = alpha*omega(l)/rcpd-d_t_dyn_z(l) 418 ! print*,'temp adv',l,-d_t_dyn_z(l) 419 d_q_adv(l,1) = -d_q_dyn_z(l) 420 ! print*,'q adv',l,-d_q_dyn_z(l) 421 dt_cooling(l) = 0.0 422 enddo 423 endif ! forcing_sandu 424 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 425 !--------------------------------------------------------------------- 426 ! Interpolation forcing in time and onto model levels 427 !--------------------------------------------------------------------- 428 if (forcing_astex) then 429 430 print*, 431 : '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_astex=', 432 : day,day1,(day-day1)*86400.,(day-day1)*86400/dt_astex 433 434 ! time interpolation: 435 ! ATTENTION, cet appel ne convient pas pour TOGA !! 436 ! revoir 1DUTILS.h et les arguments 437 CALL interp_astex_time(daytime,day1,annee_ref 438 i ,year_ini_astex,day_ju_ini_astex,nt_astex,dt_astex 439 i ,nlev_astex,div_astex,ts_astex,ug_astex,vg_astex 440 i ,ufa_astex,vfa_astex,div_prof,ts_prof,ug_prof,vg_prof 441 i ,ufa_prof,vfa_prof) 442 443 if (type_ts_forcing.eq.1) ts_cur = ts_prof ! SST used in read_tsurf1d 444 445 ! vertical interpolation: 446 CALL interp_astex_vertical(play,nlev_astex,plev_profa 447 : ,t_profa,thl_profa,qv_profa,ql_profa,qt_profa 448 : ,u_profa,v_profa,w_profa,tke_profa,o3mmr_profa 449 : ,t_mod,thl_mod,qv_mod,ql_mod,qt_mod,u_mod,v_mod,w_mod 450 : ,tke_mod,o3mmr_mod,mxcalc) 451 !calcul de l'advection verticale 452 !Calcul des gradients verticaux 453 !initialisation 454 d_t_z(:)=0. 455 d_q_z(:)=0. 456 d_t_dyn_z(:)=0. 457 d_q_dyn_z(:)=0. 458 ! schema centre 459 ! DO l=2,llm-1 460 ! d_t_z(l)=(temp(l+1)-temp(l-1)) 461 ! & /(play(l+1)-play(l-1)) 462 ! d_q_z(l)=(q(l+1,1)-q(l-1,1)) 463 ! & /(play(l+1)-play(l-1)) 464 ! schema amont 465 DO l=2,llm-1 466 d_t_z(l)=(temp(l+1)-temp(l))/(play(l+1)-play(l)) 467 d_q_z(l)=(q(l+1,1)-q(l,1))/(play(l+1)-play(l)) 468 ! print *,'l temp2 temp0 play2 play0 omega_mod', 469 ! & temp(l+1),temp(l-1),play(l+1),play(l-1),omega_mod(l) 470 ENDDO 471 d_t_z(1)=d_t_z(2) 472 d_q_z(1)=d_q_z(2) 473 d_t_z(llm)=d_t_z(llm-1) 474 d_q_z(llm)=d_q_z(llm-1) 475 476 ! calcul de l advection verticale 477 ! Confusion w (m/s) et omega (Pa/s) !! 478 d_t_dyn_z(:)=w_mod(:)*d_t_z(:) 479 d_q_dyn_z(:)=w_mod(:)*d_q_z(:) 480 ! do l=1,llm 481 ! print *,'d_t_dyn omega_mod d_t_z d_q_dyn d_q_z', 482 ! :l,d_t_dyn_z(l),omega_mod(l),d_t_z(l),d_q_dyn_z(l),d_q_z(l) 483 ! enddo 484 485 486 ! large-scale forcing : pour le cas Astex ces forcages sont la SST 487 ! la divergence,ug,vg,ufa,vfa 488 tsurf = ts_prof 489 write(*,*) 'SST suivante: ',tsurf 490 do l = 1, llm 491 omega(l) = w_mod(l) 492 omega2(l)= omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq 493 494 alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) 495 ! 496 ! d_th_adv(l) = 0.0 497 ! d_q_adv(l,1) = 0.0 498 !CR:test advection=0 499 !calcul de l'advection verticale 500 d_th_adv(l) = alpha*omega(l)/rcpd-d_t_dyn_z(l) 501 ! print*,'temp adv',l,-d_t_dyn_z(l) 502 d_q_adv(l,1) = -d_q_dyn_z(l) 503 ! print*,'q adv',l,-d_q_dyn_z(l) 504 dt_cooling(l) = 0.0 505 enddo 506 endif ! forcing_astex 507 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 508 -
LMDZ5/branches/testing/libf/phy1d/1D_read_forc_cases.h
r1665 r1795 4 4 !---------------------------------------------------------------------- 5 5 6 if (forcing_les .or. forcing_radconv .or. forcing_GCSSold ) then 7 6 if (forcing_les .or. forcing_radconv 7 : .or. forcing_GCSSold .or. forcing_fire) then 8 9 if (forcing_fire) then 10 !---------------------------------------------------------------------- 11 !read fire forcings from fire.nc 12 !---------------------------------------------------------------------- 13 fich_fire='fire.nc' 14 call read_fire(fich_fire,nlev_fire,nt_fire 15 : ,height,tttprof,qtprof,uprof,vprof,e12prof 16 : ,ugprof,vgprof,wfls,dqtdxls 17 : ,dqtdyls,dqtdtls,thlpcar) 18 write(*,*) 'Forcing FIRE lu' 19 kmax=120 ! nombre de niveaux dans les profils et forcages 20 else 8 21 !---------------------------------------------------------------------- 9 22 ! Read profiles from files: prof.inp.001 and lscale.inp.001 … … 16 29 . wfls,dqtdxls,dqtdyls,dqtdtls, 17 30 . thlpcar) 31 endif 18 32 19 33 ! compute altitudes of play levels. … … 35 49 frac = (height(kmax)-zlay(l))/(height (kmax)-height(kmax-1)) 36 50 ttt =tttprof(kmax)-frac*(tttprof(kmax)-tttprof(kmax-1)) 37 if (forcing_GCSSold .AND. tp_ini_GCSSold)then ! pot. temp. in initial profile51 if ((forcing_GCSSold .AND. tp_ini_GCSSold) .OR. forcing_fire)then ! pot. temp. in initial profile 38 52 temp(l) = ttt*(play(l)/pzero)**rkappa 39 53 teta(l) = ttt 40 54 else 41 55 temp(l) = ttt 42 56 teta(l) = ttt*(pzero/play(l))**rkappa 43 57 endif 44 58 print *,' temp,teta ',l,temp(l),teta(l) 45 59 q(l,1) = qtprof(kmax)-frac*( qtprof(kmax)- qtprof(kmax-1)) … … 58 72 if(zlay(l)>height(k-1).and.zlay(l)<height(k)) then 59 73 ttt =tttprof(k)-frac*(tttprof(k)-tttprof(k-1)) 60 if (forcing_GCSSold .AND. tp_ini_GCSSold)then ! pot. temp. in initial profile74 if ((forcing_GCSSold .AND. tp_ini_GCSSold) .OR. forcing_fire)then ! pot. temp. in initial profile 61 75 temp(l) = ttt*(play(l)/pzero)**rkappa 62 76 teta(l) = ttt 63 77 else 64 78 temp(l) = ttt 65 79 teta(l) = ttt*(pzero/play(l))**rkappa 66 80 endif 67 81 print *,' temp,teta ',l,temp(l),teta(l) 68 82 q(l,1) = qtprof(k)-frac*( qtprof(k)- qtprof(k-1)) … … 77 91 elseif(zlay(l)<height(1)) then ! profils uniformes pour z<height(1) 78 92 ttt =tttprof(1) 79 if (forcing_GCSSold .AND. tp_ini_GCSSold)then ! pot. temp. in initial profile93 if ((forcing_GCSSold .AND. tp_ini_GCSSold) .OR. forcing_fire)then ! pot. temp. in initial profile 80 94 temp(l) = ttt*(play(l)/pzero)**rkappa 81 95 teta(l) = ttt 82 96 else 83 97 temp(l) = ttt 84 98 teta(l) = ttt*(pzero/play(l))**rkappa 85 99 endif 86 100 q(l,1) = qtprof(1) 87 101 u(l) = uprof(1) … … 112 126 enddo 113 127 114 endif ! forcing_les .or. forcing_GCSSold 128 endif ! forcing_les .or. forcing_GCSSold .or. forcing_fire 115 129 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 116 130 !--------------------------------------------------------------------- … … 263 277 264 278 endif !forcing_twpice 279 280 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 281 !--------------------------------------------------------------------- 282 ! Forcing from AMMA experiment (Couvreux et al. 2010) : 283 !--------------------------------------------------------------------- 284 285 if (forcing_amma) then 286 !read AMMA forcings 287 fich_amma='amma.nc' 288 call read_amma(fich_amma,nlev_amma,nt_amma 289 : ,z_amma,plev_amma,th_amma,q_amma,u_amma,v_amma,vitw_amma 290 : ,ht_amma,hq_amma,sens_amma,lat_amma) 291 292 write(*,*) 'Forcing AMMA lu' 293 294 !champs initiaux: 295 do k=1,nlev_amma 296 th_ammai(k)=th_amma(k) 297 q_ammai(k)=q_amma(k) 298 u_ammai(k)=u_amma(k) 299 v_ammai(k)=v_amma(k) 300 vitw_ammai(k)=vitw_amma(k,12) 301 ht_ammai(k)=ht_amma(k,12) 302 hq_ammai(k)=hq_amma(k,12) 303 vt_ammai(k)=0. 304 vq_ammai(k)=0. 305 enddo 306 omega(:)=0. 307 omega2(:)=0. 308 rho(:)=0. 309 ! vertical interpolation using TOGA interpolation routine: 310 ! write(*,*)'avant interp vert', t_proftwp 311 CALL interp_toga_vertical(play,nlev_amma,plev_amma 312 : ,th_ammai,q_ammai,u_ammai,v_ammai,vitw_ammai 313 : ,ht_ammai,vt_ammai,hq_ammai,vq_ammai 314 : ,t_mod,q_mod,u_mod,v_mod,w_mod 315 : ,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc) 316 ! write(*,*) 'Profil initial forcing TWP-ICE interpole',t_mod 317 318 ! initial and boundary conditions : 319 ! tsurf = ts_proftwp 320 write(*,*) 'SST initiale mxcalc: ',tsurf,mxcalc 321 do l = 1, llm 322 ! Ligne du dessous à decommenter si on lit theta au lieu de temp 323 ! temp(l) = t_mod(l)*(play(l)/pzero)**rkappa 324 temp(l) = t_mod(l) 325 q(l,1) = q_mod(l) 326 q(l,2) = 0.0 327 ! print *,'read_forc: l,temp,q=',l,temp(l),q(l,1) 328 u(l) = u_mod(l) 329 v(l) = v_mod(l) 330 rho(l) = play(l)/(rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))) 331 omega(l) = w_mod(l)*(-rg*rho(l)) 332 omega2(l)=omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq 333 334 alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) 335 !on applique le forcage total au premier pas de temps 336 !attention: signe different de toga 337 d_th_adv(l) = alpha*omega(l)/rcpd+ht_mod(l) 338 !forcage en th 339 ! d_th_adv(l) = ht_mod(l) 340 d_q_adv(l,1) = hq_mod(l) 341 d_q_adv(l,2) = 0.0 342 dt_cooling(l)=0. 343 enddo 344 write(*,*) 'Profil initial forcing AMMA interpole temp39', 345 & temp(39) 346 347 348 ! ok_flux_surf=.false. 349 fsens=-1.*sens_amma(12) 350 flat=-1.*lat_amma(12) 351 352 endif !forcing_amma 353 354 265 355 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 266 356 !--------------------------------------------------------------------- … … 366 456 endif ! forcing_armcu 367 457 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 368 458 !--------------------------------------------------------------------- 459 ! Forcing from transition case of Irina Sandu 460 !--------------------------------------------------------------------- 461 462 if (forcing_sandu) then 463 write(*,*) 'Avant lecture Forcing SANDU' 464 465 ! read sanduref forcing : 466 fich_sandu = './ifa_sanduref.txt' 467 CALL read_sandu(fich_sandu,nlev_sandu,nt_sandu,ts_sandu) 468 469 write(*,*) 'Forcing SANDU lu' 470 471 !---------------------------------------------------------------------- 472 ! Read profiles from file: prof.inp.001 473 !---------------------------------------------------------------------- 474 475 call readprofile_sandu(nlev_max,kmax,height,plev_profs,t_profs, 476 . thl_profs,q_profs,u_profs,v_profs, 477 . w_profs,omega_profs,o3mmr_profs) 478 479 ! time interpolation for initial conditions: 480 write(*,*) 'AVT 1ere INTERPOLATION: day,day1 = ',day,day1 481 ! ATTENTION, cet appel ne convient pas pour le cas SANDU !! 482 ! revoir 1DUTILS.h et les arguments 483 484 print *,'Avant interp_sandu_time' 485 print *,'daytime=',daytime 486 print *,'day1=',day1 487 print *,'annee_ref=',annee_ref 488 print *,'year_ini_sandu=',year_ini_sandu 489 print *,'day_ju_ini_sandu=',day_ju_ini_sandu 490 print *,'nt_sandu=',nt_sandu 491 print *,'dt_sandu=',dt_sandu 492 print *,'nlev_sandu=',nlev_sandu 493 CALL interp_sandu_time(daytime,day1,annee_ref 494 i ,year_ini_sandu,day_ju_ini_sandu,nt_sandu,dt_sandu 495 i ,nlev_sandu 496 i ,ts_sandu,ts_prof) 497 498 ! vertical interpolation: 499 print *,'Avant interp_vertical: nlev_sandu=',nlev_sandu 500 CALL interp_sandu_vertical(play,nlev_sandu,plev_profs 501 : ,t_profs,thl_profs,q_profs,u_profs,v_profs,w_profs 502 : ,omega_profs,o3mmr_profs 503 : ,t_mod,thl_mod,q_mod,u_mod,v_mod,w_mod 504 : ,omega_mod,o3mmr_mod,mxcalc) 505 write(*,*) 'Profil initial forcing SANDU interpole' 506 507 ! initial and boundary conditions : 508 tsurf = ts_prof 509 write(*,*) 'SST initiale: ',tsurf 510 do l = 1, llm 511 temp(l) = t_mod(l) 512 tetal(l)=thl_mod(l) 513 q(l,1) = q_mod(l) 514 q(l,2) = 0.0 515 u(l) = u_mod(l) 516 v(l) = v_mod(l) 517 w(l) = w_mod(l) 518 omega(l) = omega_mod(l) 519 omega2(l)=omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq 520 !? rho(l) = play(l)/(rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))) 521 !? omega2(l)=-rho(l)*omega(l) 522 alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) 523 ! d_th_adv(l) = alpha*omega(l)/rcpd+vt_mod(l) 524 ! d_q_adv(l,1) = vq_mod(l) 525 d_th_adv(l) = alpha*omega(l)/rcpd 526 d_q_adv(l,1) = 0.0 527 d_q_adv(l,2) = 0.0 528 enddo 529 530 endif ! forcing_sandu 531 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 532 !--------------------------------------------------------------------- 533 ! Forcing from Astex case 534 !--------------------------------------------------------------------- 535 536 if (forcing_astex) then 537 write(*,*) 'Avant lecture Forcing Astex' 538 539 ! read astex forcing : 540 fich_astex = './ifa_astex.txt' 541 CALL read_astex(fich_astex,nlev_astex,nt_astex,div_astex,ts_astex, 542 : ug_astex,vg_astex,ufa_astex,vfa_astex) 543 544 write(*,*) 'Forcing Astex lu' 545 546 !---------------------------------------------------------------------- 547 ! Read profiles from file: prof.inp.001 548 !---------------------------------------------------------------------- 549 550 call readprofile_astex(nlev_max,kmax,height,plev_profa,t_profa, 551 . thl_profa,qv_profa,ql_profa,qt_profa,u_profa,v_profa, 552 . w_profa,tke_profa,o3mmr_profa) 553 554 ! time interpolation for initial conditions: 555 write(*,*) 'AVT 1ere INTERPOLATION: day,day1 = ',day,day1 556 ! ATTENTION, cet appel ne convient pas pour le cas SANDU !! 557 ! revoir 1DUTILS.h et les arguments 558 559 print *,'Avant interp_astex_time' 560 print *,'daytime=',daytime 561 print *,'day1=',day1 562 print *,'annee_ref=',annee_ref 563 print *,'year_ini_astex=',year_ini_astex 564 print *,'day_ju_ini_astex=',day_ju_ini_astex 565 print *,'nt_astex=',nt_astex 566 print *,'dt_astex=',dt_astex 567 print *,'nlev_astex=',nlev_astex 568 CALL interp_astex_time(daytime,day1,annee_ref 569 i ,year_ini_astex,day_ju_ini_astex,nt_astex,dt_astex 570 i ,nlev_astex,div_astex,ts_astex,ug_astex,vg_astex 571 i ,ufa_astex,vfa_astex,div_prof,ts_prof,ug_prof,vg_prof 572 i ,ufa_prof,vfa_prof) 573 574 ! vertical interpolation: 575 print *,'Avant interp_vertical: nlev_astex=',nlev_astex 576 CALL interp_astex_vertical(play,nlev_astex,plev_profa 577 : ,t_profa,thl_profa,qv_profa,ql_profa,qt_profa 578 : ,u_profa,v_profa,w_profa,tke_profa,o3mmr_profa 579 : ,t_mod,thl_mod,qv_mod,ql_mod,qt_mod,u_mod,v_mod,w_mod 580 : ,tke_mod,o3mmr_mod,mxcalc) 581 write(*,*) 'Profil initial forcing Astex interpole' 582 583 ! initial and boundary conditions : 584 tsurf = ts_prof 585 write(*,*) 'SST initiale: ',tsurf 586 do l = 1, llm 587 temp(l) = t_mod(l) 588 tetal(l)=thl_mod(l) 589 q(l,1) = qv_mod(l) 590 q(l,2) = ql_mod(l) 591 u(l) = u_mod(l) 592 v(l) = v_mod(l) 593 w(l) = w_mod(l) 594 omega(l) = w_mod(l) 595 ! omega2(l)=omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq 596 ! rho(l) = play(l)/(rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))) 597 ! omega2(l)=-rho(l)*omega(l) 598 alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) 599 ! d_th_adv(l) = alpha*omega(l)/rcpd+vt_mod(l) 600 ! d_q_adv(l,1) = vq_mod(l) 601 d_th_adv(l) = alpha*omega(l)/rcpd 602 d_q_adv(l,1) = 0.0 603 d_q_adv(l,2) = 0.0 604 enddo 605 606 endif ! forcing_astex 607 -
LMDZ5/branches/testing/libf/phy1d/compar1d.h
r1665 r1795 25 25 26 26 logical :: restart 27 logical :: ok_old_disvert 27 28 28 29 common/com_par1d/forcing_type,nat_surf,tsurf,rugos, & 29 30 & qsol,qsurf,psurf,zsurf,albedo,time,time_ini,xlat,xlon,airefi, & 30 31 & wtsurf,wqsurf,restart_runoff,xagesno,qsolinp,zpicinp, & 31 & restart 32 & restart,ok_old_disvert 32 33 33 34 !$OMP THREADPRIVATE(/com_par1d/) -
LMDZ5/branches/testing/libf/phy1d/lmdz1d.F
r1750 r1795 6 6 use dimphy 7 7 use surface_data, only : type_ocean,ok_veget 8 use pbl_surface_mod, only : pbl_surface_init, pbl_surface_final 8 use pbl_surface_mod, only : ftsoil, pbl_surface_init, 9 $ pbl_surface_final 9 10 use fonte_neige_mod, only : fonte_neige_init, fonte_neige_final 10 11 11 12 use infotrac ! new 12 13 use control_mod 14 USE indice_sol_mod 13 15 14 16 implicit none … … 20 22 #include "clesphys.h" 21 23 #include "dimsoil.h" 22 #include "indicesol.h"24 !#include "indicesol.h" 23 25 24 26 #include "comvert.h" 25 27 #include "compar1d.h" 26 28 #include "flux_arp.h" 29 #include "tsoilnudge.h" 27 30 #include "fcg_gcssold.h" 28 31 !!!#include "fbforcing.h" … … 86 89 87 90 integer :: kmax = llm 88 integer nlev_max 89 parameter (nlev_max = 100 )91 integer nlev_max,llm700 92 parameter (nlev_max = 1000) 90 93 real timestep, frac, timeit 91 94 real height(nlev_max),tttprof(nlev_max),qtprof(nlev_max), … … 98 101 c integer :: forcing_type 99 102 logical :: forcing_les = .false. 100 logical :: forcing_armcu = .false.103 logical :: forcing_armcu = .false. 101 104 logical :: forcing_rico = .false. 102 105 logical :: forcing_radconv = .false. 103 106 logical :: forcing_toga = .false. 104 107 logical :: forcing_twpice = .false. 108 logical :: forcing_amma = .false. 105 109 logical :: forcing_GCM2SCM = .false. 106 110 logical :: forcing_GCSSold = .false. 111 logical :: forcing_sandu = .false. 112 logical :: forcing_astex = .false. 113 logical :: forcing_fire = .false. 107 114 integer :: type_ts_forcing ! 0 = SST constant; 1 = SST read from a file 108 115 ! (cf read_tsurf1d.F) 109 116 110 117 !vertical advection computation 111 112 113 114 118 ! real d_t_z(llm), d_q_z(llm) 119 ! real d_t_dyn_z(llm), d_q_dyn_z(llm) 120 ! real zz(llm) 121 ! real zfact 115 122 116 123 !flag forcings … … 129 136 real :: pzero=1.e5 130 137 real :: play (llm),zlay (llm),sig_s(llm),plev(llm+1) 131 real :: playd(llm),zlayd(llm) 138 real :: playd(llm),zlayd(llm),ap_amma(llm+1),bp_amma(llm+1),poub 132 139 133 140 !--------------------------------------------------------------------- … … 137 144 integer :: iq 138 145 real :: phi(llm) 139 real :: teta(llm),temp(llm),u(llm),v(llm) 146 real :: teta(llm),tetal(llm),temp(llm),u(llm),v(llm),w(llm) 147 real :: rlat_rad(1),rlon_rad(1) 140 148 real :: omega(llm+1),omega2(llm),rho(llm+1) 141 149 real :: ug(llm),vg(llm),fcoriolis 150 real :: sfdt, cfdt 142 151 real :: du_phys(llm),dv_phys(llm),dt_phys(llm) 143 152 real :: du_dyn(llm),dv_dyn(llm),dt_dyn(llm) … … 194 203 ! Fichiers et d'autres variables 195 204 !--------------------------------------------------------------------- 196 real ttt 205 real ttt,bow,q1 197 206 integer :: ierr,k,l,i,it=1,mxcalc 198 207 integer jjmp1 … … 250 259 ! initial profiles from RICO files 251 260 ! LS convergence imposed from RICO files 261 !forcing_type = 6 ==> forcing_amma = .true. 262 ! initial profiles from AMMA nc file 263 ! LS convergence, omega and surface fluxes imposed from AMMA file 252 264 !forcing_type = 40 ==> forcing_GCSSold = .true. 253 265 ! initial profile from GCSS file 254 266 ! LS convergence imposed from GCSS file 267 !forcing_type = 59 ==> forcing_sandu = .true. 268 ! initial profiles from sanduref file: see prof.inp.001 269 ! SST varying with time and divergence constante: see ifa_sanduref.txt file 270 ! Radiation has to be computed interactively 271 !forcing_type = 60 ==> forcing_astex = .true. 272 ! initial profiles from file: see prof.inp.001 273 ! SST,divergence,ug,vg,ufa,vfa varying with time : see ifa_astex.txt file 274 ! Radiation has to be computed interactively 255 275 !forcing_type = 61 ==> forcing_armcu = .true. 256 ! initial profile from arm_cu file 257 ! LS convergence imposed from arm_cu file 276 ! initial profiles from file: see prof.inp.001 277 ! sensible and latent heat flux imposed: see ifa_arm_cu_1.txt 278 ! large scale advective forcing & radiative tendencies applied below 1000m: see ifa_arm_cu_2.txt 279 ! use geostrophic wind ug=10m/s vg=0m/s. Duration of the case 53100s 280 ! Radiation to be switched off 258 281 ! 259 282 if (forcing_type .eq.0) THEN … … 269 292 elseif (forcing_type .eq.5) THEN 270 293 forcing_rico = .true. 294 elseif (forcing_type .eq.6) THEN 295 forcing_amma = .true. 271 296 elseif (forcing_type .eq.40) THEN 272 297 forcing_GCSSold = .true. 298 elseif (forcing_type .eq.59) THEN 299 forcing_sandu = .true. 300 elseif (forcing_type .eq.60) THEN 301 forcing_astex = .true. 273 302 elseif (forcing_type .eq.61) THEN 274 303 forcing_armcu = .true. … … 276 305 else 277 306 write (*,*) 'ERROR : unknown forcing_type ', forcing_type 278 stop 'Forcing_type should be 0,1,2,3 or 40'307 stop 'Forcing_type should be 0,1,2,3,4,5,6 or 40,59,60,61' 279 308 ENDIF 280 309 print*,"forcing type=",forcing_type … … 286 315 287 316 type_ts_forcing = 0 288 if (forcing_toga) type_ts_forcing = 1 317 if (forcing_toga .or. forcing_sandu .or. forcing_astex) 318 : type_ts_forcing = 1 289 319 290 320 !--------------------------------------------------------------------- … … 325 355 c Special case for arm_cu which lasts less than one day : 53100s !! (MPL 20111026) 326 356 IF(forcing_type .EQ. 61) fnday=53100./86400. 357 c Special case for amma which lasts less than one day : 64800s !! (MPL 20120216) 358 IF(forcing_type .EQ. 6) fnday=64800./86400. 327 359 annee_ref = anneeref 328 360 mois = 1 … … 334 366 day_ini = day 335 367 day_end = day_ini + nday 368 369 IF (forcing_type .eq.2) THEN 336 370 ! Convert the initial date of Toga-Coare to Julian day 337 371 call ymds2ju 338 372 $ (year_ini_toga,mth_ini_toga,day_ini_toga,heure,day_ju_ini_toga) 339 373 374 ELSEIF (forcing_type .eq.4) THEN 340 375 ! Convert the initial date of TWPICE to Julian day 341 376 call ymds2ju 342 377 $ (year_ini_twpi,mth_ini_twpi,day_ini_twpi,heure_ini_twpi 343 378 $ ,day_ju_ini_twpi) 344 345 ! Convert the initial date of Arm_cu to Julian day 379 ELSEIF (forcing_type .eq.6) THEN 380 ! Convert the initial date of AMMA to Julian day 381 call ymds2ju 382 $ (year_ini_amma,mth_ini_amma,day_ini_amma,heure_ini_amma 383 $ ,day_ju_ini_amma) 384 385 ELSEIF (forcing_type .eq.59) THEN 386 ! Convert the initial date of Sandu case to Julian day 387 call ymds2ju 388 $ (year_ini_sandu,mth_ini_sandu,day_ini_sandu, 389 $ time_ini*3600.,day_ju_ini_sandu) 390 391 ELSEIF (forcing_type .eq.60) THEN 392 ! Convert the initial date of Astex case to Julian day 393 call ymds2ju 394 $ (year_ini_astex,mth_ini_astex,day_ini_astex, 395 $ time_ini*3600.,day_ju_ini_astex) 396 397 ELSEIF (forcing_type .eq.61) THEN 398 399 ! Convert the initial date of Arm_cu case to Julian day 346 400 call ymds2ju 347 401 $ (year_ini_armcu,mth_ini_armcu,day_ini_armcu,heure_ini_armcu 348 402 $ ,day_ju_ini_armcu) 403 ENDIF 349 404 350 405 daytime = day + time_ini/24. ! 1st day and initial time of the simulation … … 418 473 !! preff= 1.01325e5 419 474 preff = psurf 420 call disvert(pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig) 475 IF (ok_old_disvert) THEN 476 call disvert0(pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig) 477 print *,'On utilise disvert0' 478 ELSE 479 call disvert(pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig, 480 : scaleheight) 481 print *,'On utilise disvert' 482 c Nouvelle version disvert permettant d imposer ap,bp (modif L.Guez) MPL 18092012 483 c Dans ce cas, on lit ap,bp dans le fichier hybrid.txt 484 ENDIF 421 485 sig_s=presnivs/preff 422 486 plev =ap+bp*psurf … … 424 488 ccc zlay=-rd*300.*log(play/psurf)/rg ! moved after reading profiles 425 489 490 IF (forcing_type .eq. 59) THEN 491 ! pour forcing_sandu, on cherche l'indice le plus proche de 700hpa#3000m 426 492 write(*,*) '***********************' 427 493 do l = 1, llm 428 494 write(*,*) 'l,play(l),presnivs(l): ',l,play(l),presnivs(l) 495 if (trouve_700 .and. play(l).le.70000) then 496 llm700=l 497 print *,'llm700,play=',llm700,play(l)/100. 498 trouve_700= .false. 499 endif 429 500 enddo 430 501 write(*,*) '***********************' 502 ENDIF 431 503 432 504 c … … 460 532 ! rday: defini dans suphel.F (86400.) 461 533 ! day_ini: lu dans run.def (dayref) 462 ! rlat ,rlon lus dans lmdz1d.def534 ! rlat_rad,rlon-rad: transformes en radian de rlat,rlon lus dans lmdz1d.def (en degres) 463 535 ! airefi,zcufi,zcvfi initialises au debut de ce programme 464 536 ! rday,ra,rg,rd,rcpd declares dans YOMCST.h et calcules dans suphel.F … … 470 542 zcufi=airefi 471 543 zcvfi=airefi 544 ! 545 rlat_rad(:)=rlat(:)*rpi/180. 546 rlon_rad(:)=rlon(:)*rpi/180. 472 547 473 548 call iniphysiq(ngrid,llm,rday,day_ini,timestep, 474 . rlat ,rlon,airefi,zcufi,zcvfi,ra,rg,rd,rcpd,1)549 . rlat_rad,rlon_rad,airefi,zcufi,zcvfi,ra,rg,rd,rcpd,(/1/)) 475 550 print*,'apres iniphysiq' 476 551 … … 501 576 agesno = xagesno 502 577 tsoil(:,:,:)=tsurf 578 !------ AMMA 2e run avec modele sol et rayonnement actif (MPL 23052012) 579 ! tsoil(1,1,1)=299.18 580 ! tsoil(1,2,1)=300.08 581 ! tsoil(1,3,1)=301.88 582 ! tsoil(1,4,1)=305.48 583 ! tsoil(1,5,1)=308.00 584 ! tsoil(1,6,1)=308.00 585 ! tsoil(1,7,1)=308.00 586 ! tsoil(1,8,1)=308.00 587 ! tsoil(1,9,1)=308.00 588 ! tsoil(1,10,1)=308.00 589 ! tsoil(1,11,1)=308.00 590 !----------------------------------------------------------------------- 503 591 call pbl_surface_init(qsol, fder, snsrf, qsurfsrf, 504 592 & evap, frugs, agesno, tsoil) … … 734 822 endif 735 823 736 if (forcing_toga .or. forcing_GCSSold .or. forcing_twpice) then 824 if (forcing_toga .or. forcing_GCSSold .or. forcing_twpice 825 : .or.forcing_amma) then 737 826 fcoriolis=0.0 ; ug=0. ; vg=0. 738 827 endif … … 748 837 : -fcoriolis*(u(1:mxcalc)-ug(1:mxcalc)) 749 838 839 !!!!!!!!!!!!!!!!!!!!!!!! 840 ! Geostrophic wind 841 !!!!!!!!!!!!!!!!!!!!!!!! 842 sfdt = sin(0.5*fcoriolis*timestep) 843 cfdt = cos(0.5*fcoriolis*timestep) 844 ! 845 du_age(1:mxcalc)= -2.*sfdt/timestep* 846 : (sfdt*(u(1:mxcalc)-ug(1:mxcalc)) - 847 : cfdt*(v(1:mxcalc)-vg(1:mxcalc)) ) 848 !! : fcoriolis*(v(1:mxcalc)-vg(1:mxcalc)) 849 ! 850 dv_age(1:mxcalc)= -2.*sfdt/timestep* 851 : (cfdt*(u(1:mxcalc)-ug(1:mxcalc)) + 852 : sfdt*(v(1:mxcalc)-vg(1:mxcalc)) ) 853 !! : -fcoriolis*(u(1:mxcalc)-ug(1:mxcalc)) 854 ! 855 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 856 ! call writefield_phy('dv_age' ,dv_age,llm) 857 ! call writefield_phy('du_age' ,du_age,llm) 858 ! call writefield_phy('du_phys' ,du_phys,llm) 859 ! call writefield_phy('u_tend' ,u,llm) 860 ! call writefield_phy('u_g' ,ug,llm) 861 ! 862 !!!!!!!!!!!!!!!!!!!!!!!!!!!!! 863 !! Increment state variables 864 !!!!!!!!!!!!!!!!!!!!!!!!!!!!! 750 865 u(1:mxcalc)=u(1:mxcalc) + timestep*( 751 866 : du_phys(1:mxcalc) … … 773 888 774 889 teta=temp*(pzero/play)**rkappa 890 ! 891 !--------------------------------------------------------------------- 892 ! Nudge soil temperature if requested 893 !--------------------------------------------------------------------- 894 895 IF (nudge_tsoil) THEN 896 ftsoil(1,isoil_nudge,:) = ftsoil(1,isoil_nudge,:) 897 . -timestep/tau_soil_nudge*(ftsoil(1,isoil_nudge,:)-Tsoil_nudge) 898 ENDIF 775 899 776 900 !--------------------------------------------------------------------- -
LMDZ5/branches/testing/libf/phy1d/ocean_forced_mod.F90
r1665 r1795 31 31 USE limit_read_mod 32 32 USE mod_grid_phy_lmdz 33 INCLUDE "indicesol.h" 33 USE indice_sol_mod 34 ! INCLUDE "indicesol.h" 34 35 INCLUDE "YOMCST.h" 35 36 … … 145 146 USE limit_read_mod 146 147 USE fonte_neige_mod, ONLY : fonte_neige 147 148 INCLUDE "indicesol.h" 148 USE indice_sol_mod 149 150 ! INCLUDE "indicesol.h" 149 151 INCLUDE "dimsoil.h" 150 152 INCLUDE "YOMCST.h" -
LMDZ5/branches/testing/libf/phy1d/surf_land_bucket_mod.F90
r1665 r1795 26 26 USE mod_grid_phy_lmdz 27 27 USE mod_phys_lmdz_para 28 USE indice_sol_mod 28 29 !**************************************************************************************** 29 30 ! Bucket calculations for surface. 30 31 ! 31 32 INCLUDE "clesphys.h" 32 INCLUDE "indicesol.h"33 ! INCLUDE "indicesol.h" 33 34 INCLUDE "dimsoil.h" 34 35 INCLUDE "YOMCST.h" -
LMDZ5/branches/testing/libf/phydev/physiq.F90
r1707 r1795 75 75 integer,save :: iwrite_phys ! output every iwrite_phys physics step 76 76 !$OMP THREADPRIVATE(iwrite_phys) 77 integer :: iwrite_phys_omp ! intermediate variable to read iwrite_phys 77 78 real :: t_ops ! frequency of the IOIPSL operations (eg average over...) 78 79 real :: t_wrt ! frequency of the IOIPSL outputs … … 86 87 ! Initialize outputs: 87 88 itau0=0 88 iwrite_phys=1 !default: output every physics timestep 89 call getin("iwrite_phys",iwrite_phys) 89 !$OMP MASTER 90 iwrite_phys_omp=1 !default: output every physics timestep 91 ! NB: getin() is not threadsafe; only one thread should call it. 92 call getin("iwrite_phys",iwrite_phys_omp) 93 !$OMP END MASTER 94 !$OMP BARRIER 95 iwrite_phys=iwrite_phys_omp 90 96 t_ops=pdtphys*iwrite_phys ! frequency of the IOIPSL operation 91 97 t_wrt=pdtphys*iwrite_phys ! frequency of the outputs in the file -
LMDZ5/branches/testing/libf/phylmd/aero_mod.F90
r1279 r1795 5 5 6 6 ! Total number of aerosols 7 INTEGER, PARAMETER :: naero_tot = 10 7 ! INTEGER, PARAMETER :: naero_tot = 10 8 !--STRAT AER 9 INTEGER, PARAMETER :: naero_tot = 11 8 10 9 11 ! Identification number used in aeropt_2bands and aeropt_5wv … … 19 21 INTEGER, PARAMETER :: id_AIBCM = 9 20 22 INTEGER, PARAMETER :: id_AIPOMM = 10 23 !--STRAT AER 24 INTEGER, PARAMETER :: id_strat = 11 25 21 26 22 27 ! Total number of aerosols actually used in LMDZ … … 31 36 ! 9 = AIBCM 32 37 !10 = AIPOMM 33 INTEGER, PARAMETER :: naero_spc = 10 38 !--STRAT AER 39 !11 = aerosols stratos 40 ! INTEGER, PARAMETER :: naero_spc = 10 41 INTEGER, PARAMETER :: naero_spc = 11 34 42 35 43 ! Corresponding names for the aerosols 36 CHARACTER(len=7),DIMENSION(naero_spc) :: name_aero=(/&44 CHARACTER(len=7),DIMENSION(naero_spc), PARAMETER :: name_aero=(/& 37 45 "ASBCM ", & 38 46 "ASPOMM ", & … … 44 52 "CIDUSTM", & 45 53 "AIBCM ", & 46 "AIPOMM " /) 54 ! "AIPOMM " /) 55 "AIPOMM ", & 56 "STRAT " /) 47 57 48 58 … … 65 75 INTEGER, parameter :: nbands = 2 66 76 67 68 77 END MODULE aero_mod -
LMDZ5/branches/testing/libf/phylmd/calbeta.F90
r793 r1795 6 6 7 7 USE dimphy 8 USE indice_sol_mod 8 9 IMPLICIT none 9 10 !====================================================================== … … 13 14 ! 14 15 ! Calculer quelques parametres pour appliquer la couche limite 15 ! ------------------------------------------------------------ 16 INCLUDE "indicesol.h" 17 16 ! ------------------------------------------------------------ 18 17 ! Variables d'entrees 19 18 !**************************************************************************************** -
LMDZ5/branches/testing/libf/phylmd/calcul_fluxs_mod.F90
r1107 r1795 12 12 13 13 USE dimphy, ONLY : klon 14 USE indice_sol_mod 14 15 15 16 ! Cette routine calcule les fluxs en h et q a l'interface et eventuellement … … 49 50 INCLUDE "YOETHF.h" 50 51 INCLUDE "FCTTRE.h" 51 INCLUDE "indicesol.h"52 52 INCLUDE "YOMCST.h" 53 53 -
LMDZ5/branches/testing/libf/phylmd/calltherm.F90
r1750 r1795 17 17 & ,alp_bl_conv,alp_bl_stat & 18 18 !!! fin nrlmd le 10/04/2012 19 & 19 & ,zqla,ztva ) 20 20 21 21 USE dimphy 22 USE indice_sol_mod 23 22 24 implicit none 23 25 #include "dimensions.h" … … 26 28 #include "iniprint.h" 27 29 28 !!! nrlmd le 10/04/201229 #include "indicesol.h"30 !!! fin nrlmd le 10/04/201231 30 32 31 !IM 140508 33 INTEGER itap 32 INTEGER, SAVE :: itap 33 !$OMP THREADPRIVATE(itap) 34 34 REAL dtime 35 35 LOGICAL debut … … 62 62 real zqla(klon,klev) 63 63 real zqta(klon,klev) 64 real ztv(klon,klev) 64 real ztv(klon,klev),ztva(klon,klev) 65 65 real zpspsk(klon,klev) 66 66 real ztla(klon,klev) … … 256 256 & ,alp_bl_conv,alp_bl_stat & 257 257 !!! fin nrlmd le 10/04/2012 258 & )258 & ,ztva ) 259 259 if (prt_level.gt.10) write(lunout,*)'Apres thermcell_main OK' 260 260 else -
LMDZ5/branches/testing/libf/phylmd/carbon_cycle_mod.F90
r1454 r1795 19 19 !$OMP THREADPRIVATE(carbon_cycle_cpl) 20 20 21 LOGICAL :: carbon_cycle_emis_comp_omp=.FALSE. 21 22 LOGICAL :: carbon_cycle_emis_comp=.FALSE. ! Calculation of emission compatible 22 23 !$OMP THREADPRIVATE(carbon_cycle_emis_comp) 23 24 25 LOGICAL :: RCO2_inter_omp 24 26 LOGICAL :: RCO2_inter ! RCO2 interactive : if true calculate new value RCO2 for the radiation scheme 25 27 !$OMP THREADPRIVATE(RCO2_inter) 26 28 27 29 ! Scalare values when no transport, from physiq.def 30 REAL :: fos_fuel_s_omp 28 31 REAL :: fos_fuel_s ! carbon_cycle_fos_fuel dans physiq.def 29 32 !$OMP THREADPRIVATE(fos_fuel_s) … … 112 115 ! Read fosil fuel value if no transport 113 116 IF (.NOT. carbon_cycle_tr) THEN 114 fos_fuel_s = 0. 115 CALL getin ('carbon_cycle_fos_fuel',fos_fuel_s) 117 !$OMP MASTER 118 fos_fuel_s_omp = 0. 119 CALL getin ('carbon_cycle_fos_fuel',fos_fuel_s_omp) 120 !$OMP END MASTER 121 !$OMP BARRIER 122 fos_fuel_s=fos_fuel_s_omp 116 123 WRITE(lunout,*) 'carbon_cycle_fos_fuel = ', fos_fuel_s 117 124 END IF … … 120 127 ! Read parmeter for calculation compatible emission 121 128 IF (.NOT. carbon_cycle_tr) THEN 122 carbon_cycle_emis_comp=.FALSE. 123 CALL getin('carbon_cycle_emis_comp',carbon_cycle_emis_comp) 129 !$OMP MASTER 130 carbon_cycle_emis_comp_omp=.FALSE. 131 CALL getin('carbon_cycle_emis_comp',carbon_cycle_emis_comp_omp) 132 !$OMP END MASTER 133 !$OMP BARRIER 134 carbon_cycle_emis_comp=carbon_cycle_emis_comp_omp 124 135 WRITE(lunout,*) 'carbon_cycle_emis_comp = ',carbon_cycle_emis_comp 125 136 IF (carbon_cycle_emis_comp) THEN … … 129 140 130 141 ! Read parameter for interactive calculation of the CO2 value for the radiation scheme 131 RCO2_inter=.FALSE. 132 CALL getin('RCO2_inter',RCO2_inter) 142 !$OMP MASTER 143 RCO2_inter_omp=.FALSE. 144 CALL getin('RCO2_inter',RCO2_inter_omp) 145 !$OMP END MASTER 146 !$OMP BARRIER 147 RCO2_inter=RCO2_inter_omp 133 148 WRITE(lunout,*) 'RCO2_inter = ', RCO2_inter 134 149 IF (RCO2_inter) THEN … … 294 309 USE phys_cal_mod, ONLY : day_cur 295 310 USE comgeomphy 311 USE indice_sol_mod 296 312 297 313 IMPLICIT NONE 298 314 299 315 INCLUDE "clesphys.h" 300 INCLUDE "indicesol.h"301 316 INCLUDE "iniprint.h" 302 317 INCLUDE "YOMCST.h" -
LMDZ5/branches/testing/libf/phylmd/change_srf_frac_mod.F90
r1707 r1795 28 28 USE cpl_mod, ONLY : cpl_receive_frac 29 29 USE ocean_slab_mod, ONLY : ocean_slab_frac 30 USE indice_sol_mod 30 31 31 32 INCLUDE "iniprint.h" 32 INCLUDE "indicesol.h"33 33 INCLUDE "YOMCST.h" 34 34 -
LMDZ5/branches/testing/libf/phylmd/clcdrag.F90
r1279 r1795 8 8 9 9 USE dimphy 10 USE indice_sol_mod 11 10 12 IMPLICIT NONE 11 13 ! ================================================================= c … … 17 19 ! 18 20 ! knon----input-I- nombre de points pour un type de surface 19 ! nsrf----input-I- indice pour le type de surface; voir indice sol.h21 ! nsrf----input-I- indice pour le type de surface; voir indice_sol_mod.F90 20 22 ! u1-------input-R- vent zonal au 1er niveau du modele 21 23 ! v1-------input-R- vent meridien au 1er niveau du modele … … 41 43 INCLUDE "YOMCST.h" 42 44 INCLUDE "YOETHF.h" 43 INCLUDE "indicesol.h"44 45 INCLUDE "clesphys.h" 45 46 ! -
LMDZ5/branches/testing/libf/phylmd/clesphys.h
r1750 r1795 12 12 LOGICAL cycle_diurne,soil_model,new_oliq,ok_orodr,ok_orolf 13 13 LOGICAL ok_limitvrai 14 INTEGER nbapp_rad, iflag_con 14 INTEGER nbapp_rad, iflag_con,iflag_ener_conserv 15 15 REAL co2_ppm, co2_ppm0, solaire 16 16 REAL(kind=8) RCO2, RCH4, RN2O, RCFC11, RCFC12 … … 79 79 COMMON/clesphys/cycle_diurne, soil_model, new_oliq, & 80 80 & ok_orodr, ok_orolf, ok_limitvrai, nbapp_rad, iflag_con & 81 & , iflag_ener_conserv & 81 82 & , co2_ppm, solaire & 82 83 & , RCO2, RCH4, RN2O, RCFC11, RCFC12 & -
LMDZ5/branches/testing/libf/phylmd/cltracrn.F90
r1409 r1795 9 9 USE dimphy 10 10 USE traclmdz_mod, ONLY : id_rn, id_pb 11 USE indice_sol_mod 12 11 13 IMPLICIT NONE 12 14 !====================================================================== … … 44 46 !====================================================================== 45 47 include "YOMCST.h" 46 include "indicesol.h"47 48 ! 48 49 !Entrees -
LMDZ5/branches/testing/libf/phylmd/coef_diff_turb_mod.F90
r1750 r1795 17 17 18 18 USE dimphy 19 USE indice_sol_mod 19 20 ! 20 21 ! Calculate coefficients(ycoefm, ycoefh) for turbulent diffusion in the … … 55 56 !**************************************************************************************** 56 57 INCLUDE "clesphys.h" 57 INCLUDE "indicesol.h"58 58 INCLUDE "iniprint.h" 59 59 INCLUDE "compbl.h" … … 158 158 159 159 ! iflag_pbl peut etre utilise comme longuer de melange 160 IF (iflag_pbl.GE. 18) THEN160 IF (iflag_pbl.GE.31) THEN 161 161 CALL vdif_kcay(knon,dtime,RG,RD,ypaprs,yt, & 162 162 yzlev,yzlay,yu,yv,yteta, & 163 163 ycdragm,yq2,q2diag,ykmm,ykmn,yustar, & 164 164 iflag_pbl) 165 ELSE 165 ELSE IF (iflag_pbl<20) THEN 166 166 CALL yamada4(knon,dtime,RG,RD,ypaprs,yt, & 167 167 yzlev,yzlay,yu,yv,yteta, & … … 187 187 188 188 USE dimphy 189 USE indice_sol_mod 189 190 190 191 !====================================================================== … … 211 212 INCLUDE "FCTTRE.h" 212 213 INCLUDE "iniprint.h" 213 INCLUDE "indicesol.h"214 214 INCLUDE "compbl.h" 215 215 INCLUDE "YOMCST.h" … … 479 479 480 480 USE dimphy 481 USE indice_sol_mod 481 482 482 483 !====================================================================== … … 523 524 REAL zdthmin(knon), zdthdp 524 525 525 INCLUDE "indicesol.h"526 526 INCLUDE "YOMCST.h" 527 527 ! -
LMDZ5/branches/testing/libf/phylmd/coefcdrag.F90
r1061 r1795 6 6 ts, qsurf, rugos, okri, ri1, & 7 7 cdram, cdrah, cdran, zri1, pref) 8 9 USE indice_sol_mod 10 8 11 IMPLICIT none 9 12 !------------------------------------------------------------------------- … … 18 21 ! klon----input-I- dimension de la grille physique (= nb_pts_latitude X nb_pts_longitude) 19 22 ! knon----input-I- nombre de points pour un type de surface 20 ! nsrf----input-I- indice pour le type de surface; voir indice sol.h23 ! nsrf----input-I- indice pour le type de surface; voir indice_sol_mod.F90 21 24 ! zxli----input-L- TRUE si calcul des cdrags selon Laurent Li 22 25 ! speed---input-R- module du vent au 1er niveau du modele … … 49 52 include "YOMCST.h" 50 53 include "YOETHF.h" 51 include "indicesol.h"52 54 ! Quelques constantes : 53 55 REAL, parameter :: RKAR=0.40, CB=5.0, CC=5.0, CD=5.0, cepdu2=(0.1)**2 -
LMDZ5/branches/testing/libf/phylmd/concvl.F
r1750 r1795 387 387 $ dd_t,dd_q,Plim1,Plim2,asupmax,supmax0, 388 388 $ asupmaxmin,lalim_conv, 389 !AC!+!RomP 390 $ da,phi,mp,phi2,d1a,dam,sij,clw, ! RomP 391 $ elij,evap,ep,wdtrainA,wdtrainM) ! RomP 392 !AC!+!RomP 389 !AC!+!RomP+jyg 390 $ da,phi,mp,phi2,d1a,dam,sij,clw,elij, ! RomP 391 $ evap,ep,epmlmMm,eplaMm, ! RomP 392 $ wdtrainA,wdtrainM) ! RomP 393 !AC!+!RomP+jyg 393 394 endif 394 395 C------------------------------------------------------------------ -
LMDZ5/branches/testing/libf/phylmd/condsurf.F
r776 r1795 5 5 USE mod_grid_phy_lmdz 6 6 USE mod_phys_lmdz_para 7 USE indice_sol_mod 7 8 IMPLICIT none 8 9 c … … 25 26 cym#include "dimensions.h" 26 27 cym#include "dimphy.h" 27 #include "indicesol.h"28 28 #include "temps.h" 29 29 #include "clesphys.h" -
LMDZ5/branches/testing/libf/phylmd/conf_phys_m.F90
r1750 r1795 18 18 iflag_ratqs,ratqsbas,ratqshaut,tau_ratqs, & 19 19 ok_ade, ok_aie, ok_cdnc, aerosol_couple, & 20 flag_aerosol, new_aod, &20 flag_aerosol, flag_aerosol_strat, new_aod, & 21 21 bl95_b0, bl95_b1,& 22 22 read_climoz, & … … 60 60 ! ok_ade, ok_aie: apply or not aerosol direct and indirect effects 61 61 ! ok_cdnc, ok cloud droplet number concentration 62 ! flag_aerosol_strat : flag pour les aerosols stratos 62 63 ! bl95_b*: parameters in the formula to link CDNC to aerosol mass conc 63 64 ! … … 72 73 LOGICAL :: ok_ade, ok_aie, ok_cdnc, aerosol_couple 73 74 INTEGER :: flag_aerosol 75 LOGICAL :: flag_aerosol_strat 74 76 LOGICAL :: new_aod 75 77 REAL :: bl95_b0, bl95_b1 … … 87 89 LOGICAL,SAVE :: ok_ade_omp, ok_aie_omp, ok_cdnc_omp, aerosol_couple_omp 88 90 INTEGER, SAVE :: flag_aerosol_omp 91 LOGICAL, SAVE :: flag_aerosol_strat_omp 89 92 LOGICAL, SAVE :: new_aod_omp 90 93 REAL,SAVE :: bl95_b0_omp, bl95_b1_omp … … 169 172 LOGICAL,SAVE :: ok_orodr_omp, ok_orolf_omp, ok_limitvrai_omp 170 173 INTEGER, SAVE :: nbapp_rad_omp, iflag_con_omp 174 INTEGER, SAVE :: iflag_ener_conserv_omp 171 175 LOGICAL,SAVE :: ok_strato_omp 172 176 LOGICAL,SAVE :: ok_hines_omp … … 306 310 flag_aerosol_omp = 0 307 311 CALL getin('flag_aerosol',flag_aerosol_omp) 312 ! 313 !Config Key = flag_aerosol_strat 314 !Config Desc = use stratospheric aerosols T/F 315 !Config Def = false 316 !Config Help = Used in physiq.F 317 ! 318 ! 319 flag_aerosol_strat_omp = .false. 320 CALL getin('flag_aerosol_strat',flag_aerosol_strat_omp) 308 321 309 322 ! Temporary variable for testing purpose!! … … 653 666 CALL getin('iflag_con',iflag_con_omp) 654 667 668 !Config Key = iflag_ener_conserv 669 !Config Desc = Flag de convection 670 !Config Def = 1 671 !Config Help = Flag pour la convection les options suivantes existent : 672 !Config -1 pour Kinetic energy correction 673 !Config 1 conservation kinetic and enthalpy 674 iflag_ener_conserv_omp = -1 675 CALL getin('iflag_ener_conserv',iflag_ener_conserv_omp) 676 677 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 655 678 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 656 679 !! … … 1637 1660 nbapp_rad = nbapp_rad_omp 1638 1661 iflag_con = iflag_con_omp 1662 iflag_ener_conserv = iflag_ener_conserv_omp 1639 1663 1640 1664 epmax = epmax_omp … … 1705 1729 aerosol_couple = aerosol_couple_omp 1706 1730 flag_aerosol=flag_aerosol_omp 1731 flag_aerosol_strat=flag_aerosol_strat_omp 1707 1732 new_aod=new_aod_omp 1708 1733 aer_type = aer_type_omp … … 1845 1870 write(lunout,*)'nbapp_rad=',nbapp_rad 1846 1871 write(lunout,*)'iflag_con=',iflag_con 1872 write(lunout,*)'iflag_ener_conserv=',iflag_ener_conserv 1847 1873 write(lunout,*)' epmax = ', epmax 1848 1874 write(lunout,*)' ok_adj_ema = ', ok_adj_ema … … 1888 1914 write(lunout,*)' aerosol_couple = ', aerosol_couple 1889 1915 write(lunout,*)' flag_aerosol = ', flag_aerosol 1916 write(lunout,*)' flag_aerosol_strat = ', flag_aerosol_strat 1890 1917 write(lunout,*)' new_aod = ', new_aod 1891 1918 write(lunout,*)' aer_type = ',aer_type -
LMDZ5/branches/testing/libf/phylmd/cpl_mod.F90
r1665 r1795 101 101 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, fco2_ocn_day 102 102 USE surface_data 103 USE indice_sol_mod 103 104 104 105 INCLUDE "dimensions.h" 105 INCLUDE "indicesol.h"106 106 INCLUDE "temps.h" 107 107 INCLUDE "iniprint.h" … … 295 295 USE phys_state_var_mod, ONLY : rlon, rlat 296 296 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl 297 298 INCLUDE "indicesol.h" 297 USE indice_sol_mod 298 299 299 INCLUDE "temps.h" 300 300 INCLUDE "iniprint.h" … … 424 424 ! 425 425 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, fco2_ocn_day 426 INCLUDE "indicesol.h"426 USE indice_sol_mod 427 427 428 428 ! Input arguments … … 541 541 ! 542 542 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send 543 INCLUDE "indicesol.h"543 USE indice_sol_mod 544 544 INCLUDE "dimensions.h" 545 545 … … 732 732 ! 733 733 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl 734 INCLUDE "indicesol.h"734 USE indice_sol_mod 735 735 INCLUDE "dimensions.h" 736 736 … … 1026 1026 USE surface_data 1027 1027 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl 1028 USE indice_sol_mod 1028 1029 ! Some includes 1029 1030 !************************************************************************************* 1030 INCLUDE "indicesol.h"1031 1031 INCLUDE "temps.h" 1032 1032 INCLUDE "dimensions.h" -
LMDZ5/branches/testing/libf/phylmd/cv3_routines.F
r1750 r1795 3561 3561 SUBROUTINE cv3_tracer(nloc,len,ncum,nd,na, 3562 3562 & ment,sigij,da,phi,phi2,d1a,dam, 3563 & ep,Vprecip,elij,clw,icb,inb) 3563 & ep,Vprecip,elij,clw,epmlmMm,eplaMm, 3564 & icb,inb) 3564 3565 implicit none 3565 3566 … … 3577 3578 real phi2(nloc,na,na) 3578 3579 real d1a(nloc,na),dam(nloc,na) 3580 real epmlmMm(nloc,na,na),eplaMm(nloc,na) 3579 3581 ! variables pour tracer dans precip de l'AA et des mel 3580 3582 c local variables: … … 3595 3597 dam(:,:)=0. 3596 3598 epm(:,:,:)=0. 3597 c 3598 ! fraction deau condensee dans les melanges convertie en precip 3599 eplaMm(:,:)=0. 3600 epmlmMm(:,:,:)=0. 3601 phi(:,:,:)=0. 3602 phi2(:,:,:)=0. 3603 c 3604 ! fraction deau condensee dans les melanges convertie en precip : epm 3605 ! et eau condensée précipitée dans masse d'air saturé : l_m*dM_m/dzdz.dzdz 3599 3606 do j=1,na 3600 3607 do k=1,na 3601 3608 do i=1,ncum 3602 3609 if(k.ge.icb(i).and.k.le.inb(i).and. 3603 & j.ge.k.and.j.le.inb(i)) then 3604 epm(i,j,k)=1.-(1.-ep(i,j))*clw(i,j)/elij(i,k,j) 3610 !!jyg & j.ge.k.and.j.le.inb(i)) then 3611 !!jyg epm(i,j,k)=1.-(1.-ep(i,j))*clw(i,j)/elij(i,k,j) 3612 & j.gt.k.and.j.le.inb(i)) then 3613 epm(i,j,k)=1.-(1.-ep(i,j))*clw(i,j)/ 3614 & max(elij(i,k,j),1.e-16) 3615 !! 3605 3616 epm(i,j,k)=max(epm(i,j,k),0.0) 3606 3617 endif … … 3608 3619 end do 3609 3620 end do 3621 3622 ! 3623 do j=1,na 3624 do k=1,na 3625 do i=1,ncum 3626 if(k.ge.icb(i).and.k.le.inb(i)) then 3627 eplaMm(i,j)=eplaMm(i,j) + ep(i,j)*clw(i,j) 3628 & *ment(i,j,k)*(1.-sigij(i,j,k)) 3629 endif 3630 end do 3631 end do 3632 end do 3633 ! 3634 do j=1,na 3635 do k=1,j-1 3636 do i=1,ncum 3637 if(k.ge.icb(i).and.k.le.inb(i).and. 3638 & j.le.inb(i)) then 3639 epmlmMm(i,j,k)=epm(i,j,k)*elij(i,k,j)*ment(i,k,j) 3640 endif 3641 end do 3642 end do 3643 end do 3610 3644 3611 3645 ! matrices pour calculer la tendance des concentrations dans cvltr.F90 … … 3622 3656 3623 3657 phi2(i,j,k)=phi(i,j,k)*epm(i,j,k) 3624 else3625 dam(i,j)=0.3626 phi2(i,j,k)=0.3627 3658 endif 3628 3659 end do -
LMDZ5/branches/testing/libf/phylmd/cv3a_uncompress.F
r1750 r1795 10 10 : ,asupmaxmin 11 11 ! 12 : ,da,phi !AC! 13 : ,mp,phi2,d1a,dam,sigij !RomP 14 : ,wdtrainA,wdtrainM,elij,clw !RomP 15 : ,evap,ep !RomP 12 : ,da,phi,mp,phi2,d1a,dam,sigij ! RomP+AC+jyg 13 : ,clw,elij,evap,ep,epmlmMm,eplaMm ! RomP 14 : ,wdtrainA,wdtrainM ! RomP 16 15 ! 17 16 o ,iflag1,kbas1,ktop1 18 : ,precip1,cbmf1,plcl1,plfc1,wbeff1,sig1,w01,ptop21 19 : ,ft1,fq1,fu1,fv1,ftra1 20 : ,sigd1,Ma1,mip1,Vprecip1,upwd1,dnwd1,dnwd01 21 : ,qcondc1,wd1,cape1,cin1 22 : ,tvp1 23 : ,ftd1,fqd1 24 : ,Plim11,Plim21,asupmax1,supmax01 25 : ,asupmaxmin1 26 ! 27 o ,da1,phi1 !AC! 28 o ,mp1,phi21,d1a1,dam1,sigij1 !RomP 29 o ,wdtrainA1,wdtrainM1,elij1,clw1 !RomP 30 o ,evap1,ep1) !RomP 17 o ,precip1,cbmf1,plcl1,plfc1,wbeff1,sig1,w01,ptop21 18 o ,ft1,fq1,fu1,fv1,ftra1 19 o ,sigd1,Ma1,mip1,Vprecip1,upwd1,dnwd1,dnwd01 20 o ,qcondc1,wd1,cape1,cin1 21 o ,tvp1 22 o ,ftd1,fqd1 23 o ,Plim11,Plim21,asupmax1,supmax01 24 o ,asupmaxmin1 25 ! 26 o ,da1,phi1,mp1,phi21,d1a1,dam1,sigij1 ! RomP+AC+jyg 27 o ,clw1,elij1,evap1,ep1,epmlmMm1,eplaMm1! RomP 28 o ,wdtrainA1,wdtrainM1) ! RomP 31 29 ! 32 30 *************************************************************** … … 67 65 real phi2(nloc,nd,nd) !RomP 68 66 real d1a(nloc,nd),dam(nloc,nd) !RomP 67 real sigij(nloc,nd,nd) !RomP 68 real clw(nloc,nd),elij(nloc,nd,nd) !RomP 69 real evap(nloc,nd),ep(nloc,nd) !RomP 70 real epmlmMm(nloc,nd,nd),eplaMm(nloc,nd) !RomP+jyg 69 71 real wdtrainA(nloc,nd), wdtrainM(nloc,nd) !RomP 70 real sigij(nloc,nd,nd) !RomP71 real elij(nloc,nd,nd),clw(nloc,nd) !RomP72 real evap(nloc,nd),ep(nloc,nd) !RomP73 72 ! 74 73 c outputs: … … 94 93 real phi21(nloc,nd,nd) !RomP 95 94 real d1a1(nloc,nd),dam1(nloc,nd) !RomP 95 real sigij1(len,nd,nd) !RomP 96 real clw1(len,nd),elij1(len,nd,nd) !RomP 97 real evap1(len,nd),ep1(len,nd) !RomP 98 real epmlmMm1(len,nd,nd),eplaMm1(len,nd) !RomP+jyg 96 99 real wdtrainA1(len,nd), wdtrainM1(len,nd) !RomP 97 real sigij1(len,nd,nd) !RomP98 real elij1(len,nd,nd),clw1(len,nd) !RomP99 real evap1(len,nd),ep1(len,nd) !RomP100 100 ! 101 101 c 102 102 c local variables: 103 integer i,k,j,k1,k2 103 integer i,k,j 104 cc integer k1,k2 104 105 105 106 do 2000 i=1,ncum … … 147 148 d1a1(idcum(i),k) = d1a(i,k) !RomP 148 149 dam1(idcum(i),k) = dam(i,k) !RomP 149 wdtrainA1(idcum(i),k)= wdtrainA(i,k) !RomP150 wdtrainM1(idcum(i),k)= wdtrainM(i,k) !RomP151 150 clw1(idcum(i),k) = clw(i,k) !RomP 152 151 evap1(idcum(i),k) = evap(i,k) !RomP 153 152 ep1(idcum(i),k) = ep(i,k) !RomP 153 eplaMm(idcum(i),k) = eplaMm(i,k) !RomP+jyg 154 wdtrainA1(idcum(i),k)= wdtrainA(i,k) !RomP 155 wdtrainM1(idcum(i),k)= wdtrainM(i,k) !RomP 154 156 ! 155 157 2010 continue … … 171 173 172 174 !AC! 173 do k2=1,nd174 do k 1=1,nd175 do j=1,nd 176 do k=1,nd 175 177 do i=1,ncum 176 phi1(idcum(i),k1,k2)=phi(i,k1,k2) !AC! 177 phi21(idcum(i),k1,k2)= phi2(idcum(i),k1,k2) !RomP 178 sigij1(idcum(i),k1,k2) = sigij(idcum(i),k1,k2) !RomP 179 elij1(idcum(i),k1,k2)= elij(idcum(i),k1,k2) !RomP 178 phi1(idcum(i),k,j) = phi(i,k,j) !AC! 179 phi21(idcum(i),k,j) = phi2(i,k,j) !RomP 180 sigij1(idcum(i),k,j) = sigij(i,k,j) !RomP 181 elij1(idcum(i),k,j) = elij(i,k,j) !RomP 182 epmlmMm(idcum(i),k,j)= epmlmMm(i,k,j) !RomP+jyg 180 183 end do 181 184 end do -
LMDZ5/branches/testing/libf/phylmd/cv_driver.F
r1750 r1795 9 9 & icb1,inb1, 10 10 & delt,Ma1,upwd1,dnwd1,dnwd01,qcondc1,wd1,cape1, 11 & da1,phi1,mp1,phi21,d1a1,dam1,sij1,clw1,elij1, 12 & evap1,ep1,epmlmMm1,eplaMm1, 13 & wdtrainA1,wdtrainM1) 11 & da1,phi1,mp1,phi21,d1a1,dam1,sij1,clw1,elij1, ! RomP 12 & evap1,ep1,epmlmMm1,eplaMm1, ! RomP 13 & wdtrainA1,wdtrainM1) ! RomP 14 14 C 15 15 USE dimphy … … 18 18 C.............................START PROLOGUE............................ 19 19 C 20 ! 21 ! All argument names (except len,nd,ntra,nloc,delt and the flags) have a "1" appended. 22 ! The "1" is removed for the corresponding compressed (local) variables. 23 ! 20 24 C PARAMETERS: 21 25 C Name Type Usage Description … … 54 58 C wd1 Real Output downdraft velocity scale for sfc fluxes 55 59 C cape1 Real Output CAPE 60 ! 61 ! wdtrainA1 Real Output precipitation detrained from adiabatic draught; 62 ! used in tracer transport (cvltr) 63 ! wdtrainM1 Real Output precipitation detrained from mixed draughts; 64 ! used in tracer transport (cvltr) 65 ! da1 Real Output used in tracer transport (cvltr) 66 ! phi1 Real Output used in tracer transport (cvltr) 67 ! mp1 Real Output used in tracer transport (cvltr) 68 ! 69 ! phi21 Real Output used in tracer transport (cvltr) 70 ! 71 ! d1a1 Real Output used in tracer transport (cvltr) 72 ! dam1 Real Output used in tracer transport (cvltr) 73 ! 74 ! evap1 Real Output 75 ! ep1 Real Output 76 ! sij1 Real Output 77 ! elij1 Real Output 56 78 C 57 79 C S. Bony, Mar 2002: … … 119 141 real epmlmMm1(len,nd,nd),eplaMm1(len,nd) 120 142 ! RomP <<< 121 122 143 ! 144 !------------------------------------------------------------------- 145 ! Original Prologue by Kerry Emanuel. 123 146 !------------------------------------------------------------------- 124 147 ! --- ARGUMENTS … … 291 314 real ments(nloc,klev,klev), qents(nloc,klev,klev) 292 315 real sij(nloc,klev,klev), elij(nloc,klev,klev) 293 ! RomP >>>294 real da(nloc,klev),phi(nloc,klev,klev),mp(nloc,klev)295 real epmlmMm(nloc,klev,klev),eplaMm(nloc,klev)296 real phi2(nloc,klev,klev)297 real d1a(nloc,klev), dam(nloc,klev)298 real wdtrainA(nloc,klev),wdtrainM(nloc,klev)299 real sigd(nloc)300 ! RomP <<<301 316 real qp(nloc,klev), up(nloc,klev), vp(nloc,klev) 302 317 real wt(nloc,klev), water(nloc,klev), evap(nloc,klev) … … 312 327 real qcondc(nloc,klev) ! cld 313 328 real wd(nloc) ! gust 329 ! 330 ! RomP >>> 331 real da(nloc,klev),phi(nloc,klev,klev),mp(nloc,klev) 332 real epmlmMm(nloc,klev,klev),eplaMm(nloc,klev) 333 real phi2(nloc,klev,klev) 334 real d1a(nloc,klev), dam(nloc,klev) 335 real wdtrainA(nloc,klev),wdtrainM(nloc,klev) 336 real sigd(nloc) 337 ! RomP <<< 314 338 315 339 nent(:,:)=0 … … 380 404 enddo 381 405 endif 406 407 ! RomP >>> 408 wdtrainA1(:,:) =0. 409 wdtrainM1(:,:) =0. 410 da1(:,:) =0. 411 phi1(:,:,:) =0. 412 epmlmMm1(:,:,:) =0. 413 eplaMm1(:,:) =0. 414 mp1(:,:) =0. 415 evap1(:,:) =0. 416 ep1(:,:) =0. 417 sij1(:,:,:) =0. 418 elij1(:,:,:) =0. 419 phi21(:,:,:) =0. 420 d1a1(:,:) =0. 421 dam1(:,:) =0. 422 ! RomP <<< 382 423 383 424 !-------------------------------------------------------------------- … … 729 770 return 730 771 end 731 -
LMDZ5/branches/testing/libf/phylmd/cva_driver.F
r1750 r1795 22 22 & ,lalim_conv, 23 23 & da1,phi1,mp1,phi21,d1a1,dam1,sigij1,clw1, ! RomP 24 & elij1,evap1,ep1, 24 & elij1,evap1,ep1,epmlmMm1,eplaMm1, ! RomP 25 25 & wdtrainA1,wdtrainM1) ! RomP 26 26 *************************************************************** … … 39 39 C.............................START PROLOGUE............................ 40 40 C 41 ! 42 ! All argument names (except len,nd,ntra,nloc,delt and the flags) have a "1" appended. 43 ! The "1" is removed for the corresponding compressed variables. 41 44 C PARAMETERS: 42 45 C Name Type Usage Description … … 99 102 C supmax01 Real Output 100 103 C asupmaxmin1 Real Output 104 ! 105 ! ftd1 Real Output Array of temperature tendency due to precipitations (K/s) of dimension ND, 106 ! defined at same grid levels as T, Q, QS and P. 107 ! 108 ! fqd1 Real Output Array of specific humidity tendencies due to precipitations ((gm/gm)/s) 109 ! of dimension ND, defined at same grid levels as T, Q, QS and P. 110 ! 111 ! wdtrainA1 Real Output precipitation detrained from adiabatic draught; 112 ! used in tracer transport (cvltr) 113 ! wdtrainM1 Real Output precipitation detrained from mixed draughts; 114 ! used in tracer transport (cvltr) 115 ! da1 Real Output used in tracer transport (cvltr) 116 ! phi1 Real Output used in tracer transport (cvltr) 117 ! mp1 Real Output used in tracer transport (cvltr) 118 ! 119 ! phi21 Real Output used in tracer transport (cvltr) 120 ! 121 ! d1a1 Real Output used in tracer transport (cvltr) 122 ! dam1 Real Output used in tracer transport (cvltr) 123 ! 124 ! epmlmMm1 Real Output used in tracer transport (cvltr) 125 ! eplaMm1 Real Output used in tracer transport (cvltr) 126 ! 127 ! evap1 Real Output 128 ! ep1 Real Output 129 ! sigij1 Real Output 130 ! elij1 Real Output 131 132 C 101 133 C S. Bony, Mar 2002: 102 134 C * Several modules corresponding to different physical processes … … 188 220 ! RomP >>> 189 221 real wdtrainA1(len,nd), wdtrainM1(len,nd) 190 real wdtrainA(nloc,klev),wdtrainM(nloc,klev)191 222 real da1(len,nd),phi1(len,nd,nd),mp1(len,nd) 192 real da(len,nd),phi(len,nd,nd)223 real epmlmMm1(len,nd,nd),eplaMm1(len,nd) 193 224 real evap1(len,nd),ep1(len,nd) 194 225 real sigij1(len,nd,nd),elij1(len,nd,nd) 195 real phi2(len,nd,nd)196 real d1a(len,nd), dam(len,nd)197 226 real phi21(len,nd,nd) 198 227 real d1a1(len,nd), dam1(len,nd) 199 228 ! RomP <<< 229 ! 230 !------------------------------------------------------------------- 231 ! Prolog by Kerry Emanuel. 200 232 !------------------------------------------------------------------- 201 233 ! --- ARGUMENTS … … 320 352 ! 321 353 ! det: Array of detrainment mass flux of dimension ND. 322 !323 ! ftd: Array of temperature tendency due to precipitations (K/s) of dimension ND,324 ! defined at same grid levels as T, Q, QS and P.325 !326 ! fqd: Array of specific humidity tendencies due to precipitations ((gm/gm)/s)327 ! of dimension ND, defined at same grid levels as T, Q, QS and P.328 !329 354 !------------------------------------------------------------------- 330 355 c … … 446 471 real wghti(nloc,nd) 447 472 real hnk(nloc),unk(nloc),vnk(nloc) 473 ! 474 ! RomP >>> 475 real wdtrainA(nloc,klev),wdtrainM(nloc,klev) 476 real da(len,nd),phi(len,nd,nd) 477 real epmlmMm(nloc,klev,klev),eplaMm(nloc,klev) 478 real phi2(len,nd,nd) 479 real d1a(len,nd), dam(len,nd) 480 ! RomP <<< 481 ! 448 482 logical, save :: first=.true. 449 483 c$OMP THREADPRIVATE(first) … … 498 532 nword4=len*nd*nd 499 533 500 ! call izilch(iflag1 ,nword1) 501 ! call zilch(iflag1 ,nword1) 502 do i=1,len 503 iflag1(i)=0 504 ktop1(i)=0 505 kbas1(i)=0 506 enddo 507 call zilch(ft1 ,nword2) 508 call zilch(fq1 ,nword2) 509 call zilch(fu1 ,nword2) 510 call zilch(fv1 ,nword2) 511 call zilch(ftra1 ,nword3) 512 call zilch(precip1 ,nword1) 513 ! call izilch(kbas1 ,nword1) 514 ! call zilch(kbas1 ,nword1) 515 ! call izilch(ktop1 ,nword1) 516 ! call zilch(ktop1 ,nword1) 517 call zilch(cbmf1 ,nword1) 518 call zilch(ptop21 ,nword1) 519 sigd1(:)=0. 520 call zilch(Ma1 ,nword2) 521 call zilch(mip1 ,nword2) 522 ! call zilch(Vprecip1,nword2) 523 Vprecip1=0. 524 call zilch(upwd1 ,nword2) 525 call zilch(dnwd1 ,nword2) 526 call zilch(dnwd01 ,nword2) 527 call zilch(qcondc1 ,nword2) 528 !test 529 ! call zilch(qcondc ,nword2) 530 call zilch(wd1 ,nword1) 531 call zilch(cape1 ,nword1) 532 call zilch(cin1 ,nword1) 533 call zilch(tvp1 ,nword2) 534 call zilch(ftd1 ,nword2) 535 call zilch(fqd1 ,nword2) 536 call zilch(Plim11 ,nword1) 537 call zilch(Plim21 ,nword1) 538 call zilch(asupmax1,nword2) 539 call zilch(supmax01,nword1) 540 call zilch(asupmaxmin1,nword1) 534 iflag1(:) = 0 535 ktop1(:) = 0 536 kbas1(:) = 0 537 ft1(:,:) = 0.0 538 fq1(:,:) = 0.0 539 fu1(:,:) = 0.0 540 fv1(:,:) = 0.0 541 ftra1(:,:,:) = 0. 542 precip1(:) = 0. 543 cbmf1(:) = 0. 544 ptop21(:) = 0. 545 sigd1(:) = 0. 546 Ma1(:,:) = 0. 547 mip1(:,:) = 0. 548 Vprecip1(:,:) = 0. 549 upwd1 (:,:) = 0. 550 dnwd1 (:,:) = 0. 551 dnwd01 (:,:) = 0. 552 qcondc1 (:,:) = 0. 553 wd1 (:) = 0. 554 cape1 (:) = 0. 555 cin1 (:) = 0. 556 tvp1 (:,:) = 0. 557 ftd1 (:,:) = 0. 558 fqd1 (:,:) = 0. 559 Plim11 (:) = 0. 560 Plim21 (:) = 0. 561 asupmax1(:,:) = 0. 562 supmax01(:) = 0. 563 asupmaxmin1(:)= 0. 541 564 c 542 565 DO il = 1,len … … 552 575 endif 553 576 577 ! RomP >>> 578 wdtrainA1(:,:) = 0. 579 wdtrainM1(:,:) = 0. 580 da1(:,:) = 0. 581 phi1(:,:,:) = 0. 582 epmlmMm1(:,:,:) = 0. 583 eplaMm1(:,:) = 0. 584 mp1(:,:) = 0. 585 evap1(:,:) = 0. 586 ep1(:,:) = 0. 587 sigij1(:,:,:) = 0. 588 elij1(:,:,:) = 0. 589 phi21(:,:,:) = 0. 590 d1a1(:,:) = 0. 591 dam1(:,:) = 0. 592 ! RomP <<< 554 593 !--------------------------------------------------------------------- 555 594 ! --- INITIALIZE LOCAL ARRAYS AND PARAMETERS … … 941 980 CALL cv3_tracer(nloc,len,ncum,nd,nd, 942 981 : ment,sigij,da,phi,phi2,d1a,dam, 943 : ep,Vprecip,elij,clw,icb,inb) 982 : ep,Vprecip,elij,clw,epmlmMm,eplaMm, 983 : icb,inb) 944 984 !RomP <<< 945 985 endif … … 964 1004 : ,asupmaxmin 965 1005 : ,da,phi,mp,phi2,d1a,dam,sigij ! RomP 966 : , wdtrainA,wdtrainM,elij,clw! RomP967 : , evap,ep! RomP1006 : ,clw,elij,evap,ep,epmlmMm,eplaMm ! RomP 1007 : ,wdtrainA,wdtrainM ! RomP 968 1008 o ,iflag1,kbas1,ktop1 969 1009 o ,precip1,cbmf1,plcl1,plfc1,wbeff1,sig1,w01,ptop21 … … 976 1016 o ,asupmaxmin1 977 1017 o ,da1,phi1,mp1,phi21,d1a1,dam1,sigij1 ! RomP 978 o , wdtrainA1,wdtrainM1,elij1,clw1! RomP979 o , evap1,ep1)! RomP1018 o ,clw1,elij1,evap1,ep1,epmlmMm1,eplaMm1! RomP 1019 o ,wdtrainA1,wdtrainM1) ! RomP 980 1020 endif 981 1021 -
LMDZ5/branches/testing/libf/phylmd/cvltr.F90
r1750 r1795 121 121 coefcoli = 0. 122 122 123 !$OMP MASTER 123 124 call getin('ccntrAA_coef',ccntrAA_coef) 124 125 call getin('ccntrENV_coef',ccntrENV_coef) 125 126 call getin('coefcoli',coefcoli) 127 !$OMP END MASTER 128 !$OMP BARRIER 126 129 print*,'cvltr coef lessivage convectif', ccntrAA_coef,ccntrENV_coef,coefcoli 127 130 -
LMDZ5/branches/testing/libf/phylmd/etat0_netcdf.F90
r1750 r1795 24 24 USE conf_phys_m, ONLY: conf_phys 25 25 ! For parameterization of ozone chemistry: 26 useregr_lat_time_coefoz_m, only: regr_lat_time_coefoz27 usepress_coefoz_m, only: press_coefoz28 useregr_pr_o3_m, only: regr_pr_o326 USE regr_lat_time_coefoz_m, only: regr_lat_time_coefoz 27 USE press_coefoz_m, only: press_coefoz 28 USE regr_pr_o3_m, only: regr_pr_o3 29 29 USE netcdf, ONLY : NF90_OPEN, NF90_NOWRITE, NF90_CLOSE, NF90_NOERR 30 USE indice_sol_mod 30 31 #endif 31 32 IMPLICIT NONE … … 47 48 #include "comvert.h" 48 49 #include "comconst.h" 49 #include "indicesol.h"50 50 #include "dimsoil.h" 51 51 #include "temps.h" … … 101 101 LOGICAL :: ok_LES, ok_ade, ok_aie, ok_cdnc, aerosol_couple, new_aod, callstats 102 102 INTEGER :: iflag_radia, flag_aerosol 103 LOGICAL :: flag_aerosol_strat 103 104 REAL :: bl95_b0, bl95_b1, fact_cldcon, facttemps, ratqsbas, ratqshaut 104 105 REAL :: tau_ratqs … … 137 138 iflag_ratqs,ratqsbas,ratqshaut,tau_ratqs, & 138 139 ok_ade, ok_aie, ok_cdnc, aerosol_couple, & 139 flag_aerosol, new_aod,&140 flag_aerosol, flag_aerosol_strat, new_aod, & 140 141 bl95_b0, bl95_b1, & 141 142 read_climoz, & -
LMDZ5/branches/testing/libf/phylmd/fonte_neige_mod.F90
r1504 r1795 9 9 !**************************************************************************************** 10 10 USE dimphy, ONLY : klon 11 USE indice_sol_mod 11 12 12 13 IMPLICIT NONE … … 44 45 ! restart file. The other variables are initialized to zero. 45 46 ! 46 INCLUDE "indicesol.h"47 47 !**************************************************************************************** 48 48 ! Input argument … … 120 120 tsurf, precip_rain, precip_snow, & 121 121 snow, qsol, tsurf_new, evap) 122 123 USE indice_sol_mod 122 124 123 125 ! Routine de traitement de la fonte de la neige dans le cas du traitement … … 139 141 ! evap 140 142 ! 141 INCLUDE "indicesol.h"142 143 INCLUDE "dimensions.h" 143 144 INCLUDE "YOETHF.h" … … 315 316 fqfonte_out, ffonte_out) 316 317 318 319 317 320 ! Cumulate ffonte, fqfonte and fqcalving respectively for 318 321 ! all type of surfaces according to their fraction. 319 322 ! 320 323 ! This routine is called from physiq.F before histwrite. 321 322 INCLUDE "indicesol.h" 323 !**************************************************************************************** 324 !**************************************************************************************** 325 326 USE indice_sol_mod 327 324 328 REAL, DIMENSION(klon,nbsrf), INTENT(IN) :: pctsrf 325 329 -
LMDZ5/branches/testing/libf/phylmd/hgardfou.F
r1664 r1795 2 2 ! $Id$ 3 3 SUBROUTINE hgardfou (t,tsol,text) 4 use dimphy 5 use phys_state_var_mod 4 USE dimphy 5 USE phys_state_var_mod 6 USE indice_sol_mod 6 7 IMPLICIT none 7 8 c====================================================================== … … 10 11 #include "dimensions.h" 11 12 #include "YOMCST.h" 12 #include "indicesol.h"13 13 #include "iniprint.h" 14 14 REAL t(klon,klev), tsol(klon,nbsrf) … … 57 57 DO i = 1, jbad 58 58 WRITE(lunout,*) 59 $ 'i,k,temperature,lon,lat,pourc ter, oce,lic,sic =',59 $ 'i,k,temperature,lon,lat,pourc ter,lic,oce,sic =', 60 60 $ jadrs(i),k,zt(jadrs(i)),rlon(jadrs(i)),rlat(jadrs(i)), 61 61 $ (pctsrf(jadrs(i),nsrf),nsrf=1,nbsrf) … … 78 78 DO i = 1, jbad 79 79 WRITE(lunout,*) 80 $ 'i,k,temperature,lon,lat,pourc ter, oce,lic,sic =',80 $ 'i,k,temperature,lon,lat,pourc ter,lic,oce,sic =', 81 81 $ jadrs(i),k,zt(jadrs(i)),rlon(jadrs(i)),rlat(jadrs(i)), 82 82 $ (pctsrf(jadrs(i),nsrf),nsrf=1,nbsrf) … … 104 104 DO i = 1, jbad 105 105 WRITE(lunout,*) 106 $ 'i,nsrf,temperature,lon,lat,pourc ter, oce,lic,sic ='106 $ 'i,nsrf,temperature,lon,lat,pourc ter,lic,oce,sic =' 107 107 $ ,jadrs(i),nsrf,zt(jadrs(i)),rlon(jadrs(i)),rlat(jadrs(i)) 108 108 $ ,pctsrf(jadrs(i),nsrf) … … 125 125 DO i = 1, jbad 126 126 WRITE(lunout,*) 127 $ 'i,nsrf,temperature,lon,lat,pourc ter, oce,lic,sic ='127 $ 'i,nsrf,temperature,lon,lat,pourc ter,lic,oce,sic =' 128 128 $ ,jadrs(i),nsrf,zt(jadrs(i)),rlon(jadrs(i)),rlat(jadrs(i)) 129 129 $ ,pctsrf(jadrs(i),nsrf) -
LMDZ5/branches/testing/libf/phylmd/hydrol.F
r766 r1795 7 7 . agesno, tsol,qsol,snow,runoff) 8 8 USE dimphy 9 USE indice_sol_mod 10 9 11 IMPLICIT none 10 12 c====================================================================== … … 26 28 cym#include "dimphy.h" 27 29 #include "YOMCST.h" 28 #include "indicesol.h"29 30 c 30 31 REAL chasno ! epaisseur du sol: 0.15 m -
LMDZ5/branches/testing/libf/phylmd/init_be.F90
r1750 r1795 7 7 USE comgeomphy 8 8 USE infotrac, ONLY : nbtr 9 USE indice_sol_mod 9 10 10 11 IMPLICIT NONE … … 21 22 INCLUDE "YOMCST.h" 22 23 INCLUDE "YOECUMF.h" 23 INCLUDE "indicesol.h"24 24 25 25 ! … … 47 47 INTEGER :: nref 48 48 PARAMETER (nref=39) 49 REAL,DIMENSION(nref) :: pref ! grille de pression de reference (bas des couches)49 REAL,DIMENSION(nref), SAVE :: pref ! grille de pression de reference (bas des couches) 50 50 DATA pref / & 51 51 101249.99999999994, 100387.17261011522, 99447.35334189111, 98357.43412194174, & -
LMDZ5/branches/testing/libf/phylmd/initphysto.F90
r1454 r1795 9 9 USE iophy 10 10 USE control_mod 11 USE indice_sol_mod 11 12 12 13 IMPLICIT NONE … … 46 47 INCLUDE "description.h" 47 48 INCLUDE "serre.h" 48 INCLUDE "indicesol.h"49 49 50 50 ! Arguments -
LMDZ5/branches/testing/libf/phylmd/initrrnpb.F90
r1409 r1795 6 6 USE infotrac, ONLY : nbtr 7 7 USE traclmdz_mod, ONLY : id_rn, id_pb 8 USE indice_sol_mod 8 9 IMPLICIT NONE 9 10 !====================================================================== … … 24 25 ! scavtr...output-R- Coefficient de lessivage 25 26 !====================================================================== 26 INCLUDE "indicesol.h" 27 !====================================================================== 28 27 29 28 REAL,DIMENSION(klon,nbsrf),INTENT(IN) :: pctsrf 30 29 REAL,DIMENSION(klon,nbsrf),INTENT(IN) :: ftsol -
LMDZ5/branches/testing/libf/phylmd/interfoce_lim.F90
r793 r1795 9 9 USE mod_grid_phy_lmdz 10 10 USE mod_phys_lmdz_para 11 USE indice_sol_mod 11 12 12 13 IMPLICIT NONE 13 14 14 INCLUDE "indicesol.h"15 15 INCLUDE "netcdf.inc" 16 16 -
LMDZ5/branches/testing/libf/phylmd/iophy.F90
r1707 r1795 6 6 ! abd REAL,private,allocatable,dimension(:),save :: io_lat 7 7 ! abd REAL,private,allocatable,dimension(:),save :: io_lon 8 REAL,allocatable,dimension(:),save :: io_lat 9 REAL,allocatable,dimension(:),save :: io_lon 10 INTEGER, save :: phys_domain_id 11 INTEGER, save :: npstn 12 INTEGER, allocatable, dimension(:), save :: nptabij 8 REAL,ALLOCATABLE,DIMENSION(:),SAVE :: io_lat 9 REAL,ALLOCATABLE,DIMENSION(:),SAVE :: io_lon 10 INTEGER, SAVE :: phys_domain_id 11 INTEGER, SAVE :: npstn 12 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: nptabij 13 INTEGER, SAVE :: itau_iophy 14 15 !$OMP THREADPRIVATE(itau_iophy) 13 16 14 17 INTERFACE histwrite_phy 15 MODULE PROCEDURE histwrite2d_phy,histwrite3d_phy 18 MODULE PROCEDURE histwrite2d_phy,histwrite3d_phy,histwrite2d_phy_old,histwrite3d_phy_old 16 19 END INTERFACE 17 20 … … 322 325 end subroutine histbeg_phy_points 323 326 324 subroutine histwrite2d_phy(nid,lpoint,name,itau,field) 325 USE dimphy 326 USE mod_phys_lmdz_para 327 SUBROUTINE histwrite2d_phy_old(nid,lpoint,name,itau,field) 328 USE dimphy 329 USE mod_phys_lmdz_para 330 USE phys_output_var_mod 327 331 USE ioipsl 328 implicit none332 IMPLICIT NONE 329 333 include 'dimensions.h' 334 include 'iniprint.h' 330 335 331 336 integer,intent(in) :: nid … … 341 346 real,allocatable,dimension(:) :: fieldok 342 347 348 343 349 IF (size(field)/=klon) CALL abort_gcm('iophy::histwrite2d','Field first dimension not equal to klon',1) 344 350 … … 349 355 ALLOCATE(index2d(iim*jj_nb)) 350 356 ALLOCATE(fieldok(iim*jj_nb)) 357 IF (prt_level >= 9) write(lunout,*)'Sending ',name,' to IOIPSL' 351 358 CALL histwrite(nid,name,itau,Field2d,iim*jj_nb,index2d) 359 IF (prt_level >= 9) write(lunout,*)'Finished sending ',name,' to IOIPSL' 352 360 else 353 361 ALLOCATE(fieldok(npstn)) … … 369 377 ENDDO 370 378 endif 379 IF (prt_level >= 9) write(lunout,*)'Sending ',name,' to IOIPSL' 371 380 CALL histwrite(nid,name,itau,fieldok,npstn,index2d) 381 IF (prt_level >= 9) write(lunout,*)'Finished sending ',name,' to IOIPSL' 372 382 ! 373 383 endif 374 384 deallocate(index2d) 375 385 deallocate(fieldok) 376 !$OMP END MASTER 377 end subroutine histwrite2d_phy 378 379 subroutine histwrite3d_phy(nid,lpoint,name,itau,field) 380 USE dimphy 381 USE mod_phys_lmdz_para 386 !$OMP END MASTER 387 388 389 end subroutine histwrite2d_phy_old 390 391 subroutine histwrite3d_phy_old(nid,lpoint,name,itau,field) 392 USE dimphy 393 USE mod_phys_lmdz_para 394 USE phys_output_var_mod 382 395 383 396 use ioipsl 384 397 implicit none 385 398 include 'dimensions.h' 399 include 'iniprint.h' 386 400 387 401 integer,intent(in) :: nid … … 396 410 real,allocatable, dimension(:,:) :: fieldok 397 411 412 398 413 IF (size(field,1)/=klon) CALL abort_gcm('iophy::histwrite3d','Field first dimension not equal to klon',1) 399 414 nlev=size(field,2) … … 411 426 ALLOCATE(index3d(iim*jj_nb*nlev)) 412 427 ALLOCATE(fieldok(iim*jj_nb,nlev)) 428 IF (prt_level >= 9) write(lunout,*)'Sending ',name,' to IOIPSL' 413 429 CALL histwrite(nid,name,itau,Field3d,iim*jj_nb*nlev,index3d) 414 else 430 IF (prt_level >= 9) write(lunout,*)'Finished sending ',name,' to IOIPSL' 431 else 415 432 nlev=size(field,2) 416 433 ALLOCATE(index3d(npstn*nlev)) … … 435 452 ENDDO 436 453 endif 454 IF (prt_level >= 9) write(lunout,*)'Sending ',name,' to IOIPSL' 437 455 CALL histwrite(nid,name,itau,fieldok,npstn*nlev,index3d) 456 IF (prt_level >= 9) write(lunout,*)'Finished sending ',name,' to IOIPSL' 438 457 endif 439 458 deallocate(index3d) 440 459 deallocate(fieldok) 441 460 !$OMP END MASTER 442 end subroutine histwrite3d_phy 461 462 end subroutine histwrite3d_phy_old 463 464 465 ! ug NOUVELLE VERSION DES WRITE AVEC LA BOUCLE DO RENTREE 466 SUBROUTINE histwrite2d_phy(var,field, STD_iff) 467 USE dimphy 468 USE mod_phys_lmdz_para 469 USE ioipsl 470 !Pour avoir nfiles, nidfiles tout ça tout ça... 471 USE phys_output_var_mod 472 473 474 475 #ifdef CPP_XIOS 476 ! USE WXIOS 477 #endif 478 479 IMPLICIT NONE 480 include 'dimensions.h' 481 482 ! integer,intent(in) :: nid 483 ! logical,intent(in) :: lpoint 484 ! character*(*), intent(IN) :: name 485 ! integer, intent(in) :: itau 486 ! real,dimension(:),intent(in) :: field 487 488 TYPE(ctrl_out), INTENT(IN) :: var 489 REAL, DIMENSION(:), INTENT(IN) :: field 490 INTEGER, INTENT(IN), OPTIONAL :: STD_iff ! ug RUSTINE POUR LES STD LEVS..... 491 492 INTEGER :: iff, iff_beg, iff_end 493 494 REAL,dimension(klon_mpi) :: buffer_omp 495 INTEGER, allocatable, dimension(:) :: index2d 496 REAL :: Field2d(iim,jj_nb) 497 498 INTEGER :: ip 499 REAL, ALLOCATABLE, DIMENSION(:) :: fieldok 500 501 ! ug RUSTINE POUR LES STD LEVS..... 502 IF (PRESENT(STD_iff)) THEN 503 iff_beg = STD_iff 504 iff_end = STD_iff 505 ELSE 506 iff_beg = 1 507 iff_end = nfiles 508 END IF 509 510 IF (size(field)/=klon) CALL abort_gcm('iophy::histwrite2d','Field first dimension not equal to klon',1) 511 512 CALL Gather_omp(field,buffer_omp) 513 !$OMP MASTER 514 CALL grid1Dto2D_mpi(buffer_omp,Field2d) 515 516 ! La boucle sur les fichiers: 517 DO iff=iff_beg, iff_end 518 IF (var%flag(iff) <= lev_files(iff) .AND. clef_files(iff)) THEN 519 520 IF(.NOT.clef_stations(iff)) THEN 521 ALLOCATE(index2d(iim*jj_nb)) 522 ALLOCATE(fieldok(iim*jj_nb)) 523 524 CALL histwrite(nid_files(iff),var%name,itau_iophy,Field2d,iim*jj_nb,index2d) 525 #ifdef CPP_XIOS 526 ! IF (iff .EQ. 1) THEN 527 ! CALL wxios_write_2D(var%name, Field2d) 528 ! ENDIF 529 #endif 530 ELSE 531 ALLOCATE(fieldok(npstn)) 532 ALLOCATE(index2d(npstn)) 533 534 IF (is_sequential) THEN 535 ! klon_mpi_begin=1 536 ! klon_mpi_end=klon 537 DO ip=1, npstn 538 fieldok(ip)=buffer_omp(nptabij(ip)) 539 ENDDO 540 ELSE 541 DO ip=1, npstn 542 ! print*,'histwrite2d is_sequential npstn ip name nptabij',npstn,ip,name,nptabij(ip) 543 IF(nptabij(ip).GE.klon_mpi_begin.AND. & 544 nptabij(ip).LE.klon_mpi_end) THEN 545 fieldok(ip)=buffer_omp(nptabij(ip)-klon_mpi_begin+1) 546 ENDIF 547 ENDDO 548 ENDIF 549 550 CALL histwrite(nid_files(iff),var%name,itau_iophy,fieldok,npstn,index2d) 551 ENDIF 552 553 deallocate(index2d) 554 deallocate(fieldok) 555 ENDIF !levfiles 556 ENDDO 557 !$OMP END MASTER 558 559 END SUBROUTINE histwrite2d_phy 560 561 562 ! ug NOUVELLE VERSION DES WRITE AVEC LA BOUCLE DO RENTREE 563 SUBROUTINE histwrite3d_phy(var, field) 564 USE dimphy 565 USE mod_phys_lmdz_para 566 567 use ioipsl 568 !Pour avoir nfiles, nidfiles tout ça tout ça... 569 USE phys_output_var_mod 570 571 572 #ifdef CPP_XIOS 573 ! USE WXIOS 574 #endif 575 576 577 IMPLICIT NONE 578 include 'dimensions.h' 579 580 ! integer,intent(in) :: nid 581 ! logical,intent(in) :: lpoint 582 ! character*(*), intent(IN) :: name 583 ! integer, intent(in) :: itau 584 ! real,dimension(:,:),intent(in) :: field ! --> field(klon,:) 585 586 TYPE(ctrl_out), INTENT(IN) :: var 587 REAL, DIMENSION(:,:), INTENT(IN) :: field ! --> field(klon,:) 588 589 590 REAL,DIMENSION(klon_mpi,SIZE(field,2)) :: buffer_omp 591 REAL :: Field3d(iim,jj_nb,SIZE(field,2)) 592 INTEGER :: ip, n, nlev, iff 593 INTEGER, ALLOCATABLE, DIMENSION(:) :: index3d 594 REAL,ALLOCATABLE, DIMENSION(:,:) :: fieldok 595 596 IF (size(field,1)/=klon) CALL abort_gcm('iophy::histwrite3d','Field first dimension not equal to klon',1) 597 nlev=size(field,2) 598 599 ! print*,'hist3d_phy mpi_rank npstn=',mpi_rank,npstn 600 601 ! DO ip=1, npstn 602 ! print*,'hist3d_phy mpi_rank nptabij',mpi_rank,nptabij(ip) 603 ! ENDDO 604 605 CALL Gather_omp(field,buffer_omp) 606 !$OMP MASTER 607 CALL grid1Dto2D_mpi(buffer_omp,field3d) 608 609 610 ! BOUCLE SUR LES FICHIERS 611 DO iff=1, nfiles 612 IF (var%flag(iff) <= lev_files(iff) .AND. clef_files(iff)) THEN 613 IF (.NOT.clef_stations(iff)) THEN 614 ALLOCATE(index3d(iim*jj_nb*nlev)) 615 ALLOCATE(fieldok(iim*jj_nb,nlev)) 616 CALL histwrite(nid_files(iff),var%name,itau_iophy,Field3d,iim*jj_nb*nlev,index3d) 617 #ifdef CPP_XIOS 618 ! IF (iff .EQ. 1) THEN 619 ! CALL wxios_write_3D(var%name, Field3d(:,:,1:klev)) 620 ! ENDIF 621 #endif 622 623 ELSE 624 nlev=size(field,2) 625 ALLOCATE(index3d(npstn*nlev)) 626 ALLOCATE(fieldok(npstn,nlev)) 627 628 IF (is_sequential) THEN 629 ! klon_mpi_begin=1 630 ! klon_mpi_end=klon 631 DO n=1, nlev 632 DO ip=1, npstn 633 fieldok(ip,n)=buffer_omp(nptabij(ip),n) 634 ENDDO 635 ENDDO 636 ELSE 637 DO n=1, nlev 638 DO ip=1, npstn 639 IF(nptabij(ip).GE.klon_mpi_begin.AND. & 640 nptabij(ip).LE.klon_mpi_end) THEN 641 fieldok(ip,n)=buffer_omp(nptabij(ip)-klon_mpi_begin+1,n) 642 ENDIF 643 ENDDO 644 ENDDO 645 ENDIF 646 CALL histwrite(nid_files(iff),var%name,itau_iophy,fieldok,npstn*nlev,index3d) 647 ENDIF 648 deallocate(index3d) 649 deallocate(fieldok) 650 ENDIF 651 ENDDO 652 !$OMP END MASTER 653 END SUBROUTINE histwrite3d_phy 443 654 444 655 end module iophy -
LMDZ5/branches/testing/libf/phylmd/limit_netcdf.F90
r1707 r1795 21 21 !------------------------------------------------------------------------------- 22 22 USE control_mod 23 USE indice_sol_mod 23 24 #ifdef CPP_EARTH 24 25 USE dimphy … … 50 51 #include "comgeom2.h" 51 52 #include "comconst.h" 52 #include "indicesol.h"53 53 54 54 !--- INPUT NETCDF FILES NAMES -------------------------------------------------- … … 276 276 USE phys_state_var_mod, ONLY : pctsrf 277 277 USE control_mod 278 use pchsp_95_m, only: pchsp_95 279 use pchfe_95_m, only: pchfe_95 280 use arth_m, only: arth 278 USE pchsp_95_m, only: pchsp_95 279 USE pchfe_95_m, only: pchfe_95 280 USE arth_m, only: arth 281 USE indice_sol_mod 281 282 282 283 IMPLICIT NONE … … 284 285 #include "paramet.h" 285 286 #include "comgeom2.h" 286 #include "indicesol.h"287 287 #include "iniprint.h" 288 288 !----------------------------------------------------------------------------- -
LMDZ5/branches/testing/libf/phylmd/limit_read_mod.F90
r1665 r1795 38 38 39 39 USE dimphy 40 INCLUDE "indicesol.h"40 USE indice_sol_mod 41 41 42 42 ! Input arguments … … 146 146 USE surface_data, ONLY : type_ocean, ok_veget 147 147 USE netcdf 148 USE indice_sol_mod 148 149 149 150 IMPLICIT NONE 150 151 151 INCLUDE "indicesol.h"152 152 INCLUDE "iniprint.h" 153 153 -
LMDZ5/branches/testing/libf/phylmd/limit_slab.F90
r1001 r1795 7 7 USE mod_phys_lmdz_para 8 8 USE netcdf 9 USE indice_sol_mod 9 10 10 11 IMPLICIT NONE 11 12 12 INCLUDE "indicesol.h"13 13 INCLUDE "temps.h" 14 14 INCLUDE "clesphys.h" -
LMDZ5/branches/testing/libf/phylmd/ocean_cpl_mod.F90
r1146 r1795 62 62 USE cpl_mod 63 63 USE calcul_fluxs_mod 64 65 INCLUDE "indicesol.h" 64 USE indice_sol_mod 65 66 66 INCLUDE "YOMCST.h" 67 67 ! … … 197 197 USE cpl_mod 198 198 USE calcul_fluxs_mod 199 200 INCLUDE "indicesol.h" 199 USE indice_sol_mod 200 201 201 INCLUDE "YOMCST.h" 202 202 -
LMDZ5/branches/testing/libf/phylmd/ocean_forced_mod.F90
r1067 r1795 30 30 USE calcul_fluxs_mod 31 31 USE limit_read_mod 32 INCLUDE "indicesol.h" 32 USE indice_sol_mod 33 33 34 INCLUDE "YOMCST.h" 34 35 … … 137 138 USE limit_read_mod 138 139 USE fonte_neige_mod, ONLY : fonte_neige 139 140 INCLUDE "indicesol.h" 140 USE indice_sol_mod 141 141 142 INCLUDE "dimsoil.h" 142 143 INCLUDE "YOMCST.h" -
LMDZ5/branches/testing/libf/phylmd/ocean_slab_mod.F90
r1067 r1795 18 18 USE limit_read_mod 19 19 USE surface_data 20 INCLUDE "indicesol.h" 20 USE indice_sol_mod 21 21 22 ! INCLUDE "clesphys.h" 22 23 … … 60 61 USE dimphy 61 62 USE calcul_fluxs_mod 62 63 INCLUDE "indicesol.h" 63 USE indice_sol_mod 64 64 65 INCLUDE "iniprint.h" 65 66 -
LMDZ5/branches/testing/libf/phylmd/pbl_surface_mod.F90
r1707 r1795 42 42 REAL, ALLOCATABLE, DIMENSION(:,:), PRIVATE, SAVE :: agesno ! age of snow at surface 43 43 !$OMP THREADPRIVATE(agesno) 44 REAL, ALLOCATABLE, DIMENSION(:,:,:), PRIVATE, SAVE :: ftsoil ! soil temperature 44 ! Correction pour le cas AMMA (PRIVATE) 45 REAL, ALLOCATABLE, DIMENSION(:,:,:), SAVE :: ftsoil ! soil temperature 45 46 !$OMP THREADPRIVATE(ftsoil) 46 47 … … 56 57 ! for the index of the different surfaces and tests the choice of type of ocean. 57 58 58 INCLUDE "indicesol.h" 59 USE indice_sol_mod 60 59 61 INCLUDE "dimsoil.h" 60 62 INCLUDE "iniprint.h" … … 176 178 alb1_m, alb2_m, zxsens, zxevap, & 177 179 zxtsol, zxfluxlat, zt2m, qsat2m, & 178 d_t, d_q, d_u, d_v, 180 d_t, d_q, d_u, d_v, d_t_diss, & 179 181 zcoefh, zcoefm, slab_wfbils, & 180 182 qsol_d, zq2m, s_pblh, s_plcl, & … … 247 249 ! 248 250 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send 251 USE indice_sol_mod 252 249 253 IMPLICIT NONE 250 254 251 INCLUDE "indicesol.h"252 255 INCLUDE "dimsoil.h" 253 256 INCLUDE "YOMCST.h" … … 259 262 INCLUDE "YOETHF.h" 260 263 INCLUDE "temps.h" 264 !**************************************************************************************** 265 ! Declarations specifiques pour le 1D. A reprendre 261 266 ! Input variables 262 267 !**************************************************************************************** … … 291 296 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: u10m ! u speed at 10m 292 297 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: v10m ! v speed at 10m 293 REAL, DIMENSION(klon, klev+1, nbsrf ), INTENT(INOUT) :: tke298 REAL, DIMENSION(klon, klev+1, nbsrf+1), INTENT(INOUT) :: tke 294 299 295 300 ! Output variables … … 310 315 REAL, DIMENSION(klon), INTENT(OUT) :: qsat2m 311 316 REAL, DIMENSION(klon, klev), INTENT(OUT) :: d_t ! change in temperature 317 REAL, DIMENSION(klon, klev), INTENT(OUT) :: d_t_diss ! change in temperature 312 318 REAL, DIMENSION(klon, klev), INTENT(OUT) :: d_q ! change in water vapour 313 319 REAL, DIMENSION(klon, klev), INTENT(OUT) :: d_u ! change in u speed 314 320 REAL, DIMENSION(klon, klev), INTENT(OUT) :: d_v ! change in v speed 315 REAL, DIMENSION(klon, klev ), INTENT(OUT) :: zcoefh ! coef for turbulent diffusion of T and Q, mean for each grid point316 REAL, DIMENSION(klon, klev ), INTENT(OUT) :: zcoefm ! coef for turbulent diffusion of U and V (?), mean for each grid point321 REAL, DIMENSION(klon, klev,nbsrf+1), INTENT(OUT) :: zcoefh ! coef for turbulent diffusion of T and Q, mean for each grid point 322 REAL, DIMENSION(klon, klev,nbsrf+1), INTENT(OUT) :: zcoefm ! coef for turbulent diffusion of U and V (?), mean for each grid point 317 323 318 324 ! Output only for diagnostics … … 424 430 REAL, DIMENSION(klon) :: ztsol 425 431 REAL, DIMENSION(klon) :: alb_m ! mean albedo for whole SW interval 426 REAL, DIMENSION(klon,klev) :: y_d_t, y_d_q 432 REAL, DIMENSION(klon,klev) :: y_d_t, y_d_q, y_d_t_diss 427 433 REAL, DIMENSION(klon,klev) :: y_d_u, y_d_v 428 434 REAL, DIMENSION(klon,klev) :: y_flux_t, y_flux_q 429 435 REAL, DIMENSION(klon,klev) :: y_flux_u, y_flux_v 430 REAL, DIMENSION(klon,klev) :: ycoefh, ycoefm 436 REAL, DIMENSION(klon,klev) :: ycoefh, ycoefm,ycoefq 431 437 REAL, DIMENSION(klon) :: ycdragh, ycdragm 432 438 REAL, DIMENSION(klon,klev) :: yu, yv … … 470 476 !**************************************************************************************** 471 477 ! Declarations specifiques pour le 1D. A reprendre 478 !**************************************************************************************** 472 479 REAL :: fsens,flat 473 480 LOGICAL :: ok_flux_surf ! initialized during first_call below 474 481 COMMON /flux_arp/fsens,flat,ok_flux_surf 475 !****************************************************************************************476 482 ! End of declarations 477 483 !**************************************************************************************** … … 546 552 d_ts = 0.0 ; yfluxlat=0.0 ; flux_t = 0.0 ; flux_q = 0.0 547 553 flux_u = 0.0 ; flux_v = 0.0 ; d_t = 0.0 ; d_q = 0.0 548 d_ u = 0.0 ; d_v = 0.0 ; yqsol = 0.0554 d_t_diss= 0.0 ;d_u = 0.0 ; d_v = 0.0 ; yqsol = 0.0 549 555 ytherm = 0.0 ; ytke=0. 550 556 551 zcoefh(:,:) = 0.0 552 zcoefh(:,1) = 999999. ! zcoefh(:,k=1) should never be used 553 zcoefm(:,:) = 0.0 554 zcoefm(:,1) = 999999. ! 557 tke(:,:,is_ave)=0. 558 IF (iflag_pbl<20.or.iflag_pbl>=30) THEN 559 zcoefh(:,:,:) = 0.0 560 zcoefh(:,1,:) = 999999. ! zcoefh(:,k=1) should never be used 561 zcoefm(:,:,:) = 0.0 562 zcoefm(:,1,:) = 999999. ! 563 ELSE 564 zcoefm(:,:,is_ave)=0. 565 zcoefh(:,:,is_ave)=0. 566 ENDIF 555 567 ytsoil = 999999. 556 568 … … 713 725 ENDDO 714 726 ENDDO 715 727 716 728 DO k = 1, nsoilmx 717 729 DO j = 1, knon … … 747 759 ypaprs, ypplay, yu, yv, yq, yt, yts, yrugos, yqsurf, ycdragm, & 748 760 ycoefm, ycoefh, ytke) 761 762 IF (iflag_pbl>=20.AND.iflag_pbl<30) THEN 763 ! In this case, coef_diff_turb is called for the Cd only 764 DO k = 2, klev 765 DO j = 1, knon 766 i = ni(j) 767 ycoefh(j,k) = zcoefh(i,k,nsrf) 768 ycoefm(j,k) = zcoefm(i,k,nsrf) 769 ENDDO 770 ENDDO 771 ENDIF 749 772 750 773 !**************************************************************************************** … … 924 947 925 948 949 y_d_t_diss(:,:)=0. 950 IF (iflag_pbl>=20 .and. iflag_pbl<30) THEN 951 CALL yamada_c(knon,dtime,ypaprs,ypplay & 952 & ,yu,yv,yt,y_d_u,y_d_v,y_d_t,ycdragm,ytke,ycoefm,ycoefh,ycoefq,y_d_t_diss,yustar & 953 & ,iflag_pbl,nsrf) 954 ENDIF 955 ! print*,'yamada_c OK' 956 926 957 DO j = 1, knon 927 958 y_dflux_t(j) = y_dflux_t(j) * ypct(j) … … 937 968 !**************************************************************************************** 938 969 939 tke(:,:,nsrf) = 0.940 970 DO k = 1, klev 941 971 DO j = 1, knon 942 972 i = ni(j) 973 y_d_t_diss(j,k) = y_d_t_diss(j,k) * ypct(j) 943 974 y_d_t(j,k) = y_d_t(j,k) * ypct(j) 944 975 y_d_q(j,k) = y_d_q(j,k) * ypct(j) … … 951 982 flux_v(i,k,nsrf) = y_flux_v(j,k) 952 983 953 tke(i,k,nsrf) = ytke(j,k)954 984 955 985 ENDDO 956 986 ENDDO 987 988 ! print*,'Dans pbl OK1' 957 989 958 990 evap(:,nsrf) = - flux_q(:,1,nsrf) … … 980 1012 END DO 981 1013 1014 ! print*,'Dans pbl OK2' 1015 982 1016 DO k = 2, klev 983 1017 DO j = 1, knon 984 1018 i = ni(j) 985 zcoefh(i,k) = zcoefh(i,k) + ycoefh(j,k)*ypct(j) 986 zcoefm(i,k) = zcoefm(i,k) + ycoefm(j,k)*ypct(j) 1019 tke(i,k,nsrf) = ytke(j,k) 1020 zcoefh(i,k,nsrf) = ycoefh(j,k) 1021 zcoefm(i,k,nsrf) = ycoefm(j,k) 1022 tke(i,k,is_ave) = tke(i,k,is_ave) + ytke(j,k)*ypct(j) 1023 zcoefh(i,k,is_ave) = zcoefh(i,k,is_ave) + ycoefh(j,k)*ypct(j) 1024 zcoefm(i,k,is_ave) = zcoefm(i,k,is_ave) + ycoefm(j,k)*ypct(j) 987 1025 END DO 988 1026 END DO 1027 1028 ! print*,'Dans pbl OK3' 989 1029 990 1030 IF ( nsrf .EQ. is_ter ) THEN … … 1007 1047 DO j = 1, knon 1008 1048 i = ni(j) 1049 d_t_diss(i,k) = d_t_diss(i,k) + y_d_t_diss(j,k) 1009 1050 d_t(i,k) = d_t(i,k) + y_d_t(j,k) 1010 1051 d_q(i,k) = d_q(i,k) + y_d_q(j,k) … … 1013 1054 END DO 1014 1055 END DO 1056 1057 ! print*,'Dans pbl OK4' 1015 1058 1016 1059 !**************************************************************************************** … … 1040 1083 ! Calculations of diagnostic t,q at 2m and u, v at 10m 1041 1084 1085 ! print*,'Dans pbl OK41' 1086 ! print*,'tair1,yt(:,1),y_d_t(:,1)' 1087 ! print*, tair1,yt(:,1),y_d_t(:,1) 1042 1088 DO j=1, knon 1043 1089 i = ni(j) 1044 1090 uzon(j) = yu(j,1) + y_d_u(j,1) 1045 1091 vmer(j) = yv(j,1) + y_d_v(j,1) 1046 tair1(j) = yt(j,1) + y_d_t(j,1) 1092 tair1(j) = yt(j,1) + y_d_t(j,1) + y_d_t_diss(j,1) 1047 1093 qair1(j) = yq(j,1) + y_d_q(j,1) 1048 1094 zgeo1(j) = RD * tair1(j) / (0.5*(ypaprs(j,1)+ypplay(j,1))) & … … 1058 1104 END DO 1059 1105 1106 ! print*,'Dans pbl OK42A' 1107 ! print*,'tair1,yt(:,1),y_d_t(:,1)' 1108 ! print*, tair1,yt(:,1),y_d_t(:,1) 1060 1109 1061 1110 ! Calculate the temperature et relative humidity at 2m and the wind at 10m … … 1064 1113 tairsol, qairsol, rugo1, psfce, patm, & 1065 1114 yt2m, yq2m, yt10m, yq10m, yu10m, yustar) 1115 ! print*,'Dans pbl OK42B' 1066 1116 1067 1117 DO j=1, knon … … 1077 1127 END DO 1078 1128 1129 ! print*,'Dans pbl OK43' 1079 1130 !IM Calcule de l'humidite relative a 2m (rh2m) pour diagnostique 1080 1131 !IM Ajoute dependance type surface … … 1093 1144 END IF 1094 1145 1146 ! print*,'OK pbl 5' 1095 1147 CALL HBTM(knon, ypaprs, ypplay, & 1096 1148 yt2m,yt10m,yq2m,yq10m,yustar, & … … 1113 1165 END DO 1114 1166 1167 ! print*,'OK pbl 6' 1115 1168 #else 1116 1169 ! T2m not defined … … 1130 1183 !**************************************************************************************** 1131 1184 1185 ! print*,'OK pbl 7' 1132 1186 zxfluxt(:,:) = 0.0 ; zxfluxq(:,:) = 0.0 1133 1187 zxfluxu(:,:) = 0.0 ; zxfluxv(:,:) = 0.0 … … 1143 1197 END DO 1144 1198 1199 ! print*,'OK pbl 8' 1145 1200 DO i = 1, klon 1146 1201 zxsens(i) = - zxfluxt(i,1) ! flux de chaleur sensible au sol … … 1161 1216 s_trmb2(:) = 0.0 ; s_trmb3(:) = 0.0 1162 1217 1218 ! print*,'OK pbl 9' 1163 1219 1164 1220 DO nsrf = 1, nbsrf … … 1192 1248 END DO 1193 1249 END DO 1250 ! print*,'OK pbl 10' 1194 1251 1195 1252 IF (check) THEN … … 1264 1321 evap_rst, rugos_rst, agesno_rst, ftsoil_rst) 1265 1322 1266 INCLUDE "indicesol.h" 1323 USE indice_sol_mod 1324 1267 1325 INCLUDE "dimsoil.h" 1268 1326 … … 1314 1372 ! Give default values where new fraction has appread 1315 1373 1316 INCLUDE "indicesol.h" 1374 USE indice_sol_mod 1375 1317 1376 INCLUDE "dimsoil.h" 1318 1377 INCLUDE "clesphys.h" -
LMDZ5/branches/testing/libf/phylmd/phyaqua.F
r1707 r1795 16 16 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 17 17 18 usecomgeomphy, only : rlatd,rlond19 usedimphy, only : klon20 usesurface_data, only : type_ocean,ok_veget21 usepbl_surface_mod, only : pbl_surface_init18 USE comgeomphy, only : rlatd,rlond 19 USE dimphy, only : klon 20 USE surface_data, only : type_ocean,ok_veget 21 USE pbl_surface_mod, only : pbl_surface_init 22 22 USE fonte_neige_mod, only : fonte_neige_init 23 use phys_state_var_mod 24 use control_mod, only : dayref,nday,iphysiq 23 USE phys_state_var_mod 24 USE control_mod, only : dayref,nday,iphysiq 25 USE indice_sol_mod 25 26 26 27 USE IOIPSL … … 33 34 #include "clesphys.h" 34 35 #include "dimsoil.h" 35 #include "indicesol.h"36 36 #include "temps.h" 37 37 … … 89 89 integer, save:: read_climoz=0 ! read ozone climatology 90 90 91 91 ! intermediate variables to use getin 92 integer :: nbapp_rad_omp 93 real :: co2_ppm_omp,solaire_omp 94 logical :: alb_ocean_omp 95 real :: rugos_omp 92 96 !------------------------------------------------------------------------- 93 97 ! declaration pour l'appel a phyredem … … 160 164 zcufi=1. 161 165 zcvfi=1. 162 nbapp_rad=24 163 CALL getin('nbapp_rad',nbapp_rad) 166 !$OMP MASTER 167 nbapp_rad_omp=24 168 CALL getin('nbapp_rad',nbapp_rad_omp) 169 !$OMP END MASTER 170 !$OMP BARRIER 171 nbapp_rad=nbapp_rad_omp 164 172 165 173 !--------------------------------------------------------------------- … … 168 176 ! Initialisations des constantes 169 177 ! Ajouter les manquants dans planete.def... (albedo etc) 170 co2_ppm=348. 171 CALL getin('co2_ppm',co2_ppm) 172 solaire=1365. 173 CALL getin('solaire',solaire) 178 !$OMP MASTER 179 co2_ppm_omp=348. 180 CALL getin('co2_ppm',co2_ppm_omp) 181 solaire_omp=1365. 182 CALL getin('solaire',solaire_omp) 183 ! CALL getin('albedo',albedo) ! albedo is set below, depending on type_aqua 184 alb_ocean_omp=.true. 185 CALL getin('alb_ocean',alb_ocean_omp) 186 !$OMP END MASTER 187 !$OMP BARRIER 188 co2_ppm=co2_ppm_omp 189 solaire=solaire_omp 190 alb_ocean=alb_ocean_omp 191 174 192 radsol=0. 175 193 qsol_f=10. 176 ! CALL getin('albedo',albedo) ! albedo is set below, depending on type_aqua177 alb_ocean=.true.178 CALL getin('alb_ocean',alb_ocean)179 194 180 195 c Conditions aux limites: … … 208 223 endif 209 224 210 CALL getin('rugos',rugos) 225 !$OMP MASTER 226 rugos_omp=rugos 227 CALL getin('rugos',rugos_omp) 228 !$OMP END MASTER 229 !$OMP BARRIER 230 rugos=rugos_omp 211 231 zmasq(:)=pctsrf(:,is_oce) 212 232 -
LMDZ5/branches/testing/libf/phylmd/phyetat0.F
r1707 r1795 23 23 USE carbon_cycle_mod,ONLY : 24 24 & carbon_cycle_tr, carbon_cycle_cpl, co2_send 25 USE indice_sol_mod 25 26 26 27 IMPLICIT none … … 31 32 #include "dimensions.h" 32 33 #include "netcdf.inc" 33 #include "indicesol.h"34 34 #include "dimsoil.h" 35 35 #include "clesphys.h" -
LMDZ5/branches/testing/libf/phylmd/phyredem.F
r1665 r1795 16 16 USE control_mod 17 17 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send 18 USE indice_sol_mod 18 19 19 20 IMPLICIT none … … 23 24 c====================================================================== 24 25 #include "netcdf.inc" 25 #include "indicesol.h"26 26 #include "dimsoil.h" 27 27 #include "clesphys.h" -
LMDZ5/branches/testing/libf/phylmd/phys_local_var_mod.F90
r1750 r1795 55 55 REAL, SAVE, ALLOCATABLE :: d_u_oli(:,:), d_v_oli(:,:) 56 56 !$OMP THREADPRIVATE(d_u_oli, d_v_oli) 57 REAL, SAVE, ALLOCATABLE :: d_t_vdf(:,:), d_q_vdf(:,:) 58 !$OMP THREADPRIVATE( d_t_vdf, d_q_vdf )57 REAL, SAVE, ALLOCATABLE :: d_t_vdf(:,:), d_q_vdf(:,:), d_t_diss(:,:) 58 !$OMP THREADPRIVATE( d_t_vdf, d_q_vdf,d_t_diss) 59 59 REAL, SAVE, ALLOCATABLE :: d_u_vdf(:,:), d_v_vdf(:,:) 60 60 !$OMP THREADPRIVATE(d_u_vdf, d_v_vdf) … … 191 191 !====================================================================== 192 192 SUBROUTINE phys_local_var_init 193 usedimphy194 useinfotrac, ONLY : nbtr193 USE dimphy 194 USE infotrac, ONLY : nbtr 195 195 USE aero_mod 196 USE indice_sol_mod 196 197 197 198 IMPLICIT NONE 198 #include "indicesol.h"199 199 allocate(t_seri(klon,klev),q_seri(klon,klev),ql_seri(klon,klev),qs_seri(klon,klev)) 200 200 allocate(u_seri(klon,klev),v_seri(klon,klev)) … … 216 216 allocate(d_t_lscth(klon,klev),d_q_lscth(klon,klev)) 217 217 allocate(plul_st(klon),plul_th(klon)) 218 allocate(d_t_vdf(klon,klev),d_q_vdf(klon,klev) )218 allocate(d_t_vdf(klon,klev),d_q_vdf(klon,klev),d_t_diss(klon,klev)) 219 219 allocate(d_u_vdf(klon,klev),d_v_vdf(klon,klev)) 220 220 allocate(d_t_oli(klon,klev),d_t_oro(klon,klev)) … … 283 283 !====================================================================== 284 284 SUBROUTINE phys_local_var_end 285 use dimphy 285 USE dimphy 286 USE indice_sol_mod 286 287 IMPLICIT NONE 287 #include "indicesol.h"288 288 deallocate(t_seri,q_seri,ql_seri,qs_seri) 289 289 deallocate(u_seri,v_seri) … … 305 305 deallocate(d_t_lscth,d_q_lscth) 306 306 deallocate(plul_st,plul_th) 307 deallocate(d_t_vdf,d_q_vdf )307 deallocate(d_t_vdf,d_q_vdf,d_t_diss) 308 308 deallocate(d_u_vdf,d_v_vdf) 309 309 deallocate(d_t_oli,d_t_oro) -
LMDZ5/branches/testing/libf/phylmd/phys_output_mod.F90
r1750 r1795 11 11 12 12 MODULE phys_output_mod 13 USE indice_sol_mod 14 USE phys_output_var_mod 15 USE phys_output_ctrlout_mod 16 USE aero_mod, only : naero_spc,name_aero 13 17 14 18 IMPLICIT NONE 15 19 16 private histdef2d, histdef3d, conf_physoutputs 17 18 19 integer, parameter :: nfiles = 6 20 logical, dimension(nfiles), save :: clef_files 21 logical, dimension(nfiles), save :: clef_stations 22 integer, dimension(nfiles), save :: lev_files 23 integer, dimension(nfiles), save :: nid_files 24 integer, dimension(nfiles), save :: nnid_files 25 !!$OMP THREADPRIVATE(clef_files, clef_stations, lev_files,nid_files,nnid_files) 26 integer, dimension(nfiles), private, save :: nnhorim 27 28 integer, dimension(nfiles), private, save :: nhorim, nvertm 29 integer, dimension(nfiles), private, save :: nvertap, nvertbp, nvertAlt 30 ! integer, dimension(nfiles), private, save :: nvertp0 31 real, dimension(nfiles), private, save :: zoutm 32 real, private, save :: zdtime 33 CHARACTER(len=20), dimension(nfiles), private, save :: type_ecri 34 !$OMP THREADPRIVATE(nhorim, nvertm, zoutm,zdtime,type_ecri) 35 ! swaero_diag : flag indicates if it is necessary to do calculation for some aerosol diagnostics 36 logical, save :: swaero_diag=.FALSE. 37 38 39 ! integer, save :: nid_hf3d 40 41 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 42 !! Definition pour chaque variable du niveau d ecriture dans chaque fichier 43 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!/ histmth, histday, histhf, histins /),'!!!!!!!!!!!! 44 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 45 46 integer, private:: levmin(nfiles) = 1 47 integer, private:: levmax(nfiles) 48 49 TYPE ctrl_out 50 integer,dimension(6) :: flag 51 character(len=20) :: name 52 END TYPE ctrl_out 53 54 !!! Comosentes de la coordonnee sigma-hybride 55 !!! Ap et Bp 56 type(ctrl_out),save :: o_Ahyb = ctrl_out((/ 1, 1, 1, 1, 1, 1 /), 'Ap') 57 type(ctrl_out),save :: o_Bhyb = ctrl_out((/ 1, 1, 1, 1, 1, 1 /), 'Bp') 58 type(ctrl_out),save :: o_Alt = ctrl_out((/ 1, 1, 1, 1, 1, 1 /), 'Alt') 59 60 !!! 1D 61 type(ctrl_out),save :: o_phis = ctrl_out((/ 1, 1, 10, 5, 1, 1 /), 'phis') 62 type(ctrl_out),save :: o_aire = ctrl_out((/ 1, 1, 10, 10, 1, 1 /),'aire') 63 type(ctrl_out),save :: o_contfracATM = ctrl_out((/ 10, 1, 1, 10, 10, 10 /),'contfracATM') 64 type(ctrl_out),save :: o_contfracOR = ctrl_out((/ 10, 1, 1, 10, 10, 10 /),'contfracOR') 65 type(ctrl_out),save :: o_aireTER = ctrl_out((/ 10, 10, 1, 10, 10, 10 /),'aireTER') 66 67 !!! 2D 68 type(ctrl_out),save :: o_flat = ctrl_out((/ 5, 1, 10, 10, 5, 10 /),'flat') 69 type(ctrl_out),save :: o_slp = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'slp') 70 type(ctrl_out),save :: o_tsol = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'tsol') 71 type(ctrl_out),save :: o_t2m = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'t2m') 72 type(ctrl_out),save :: o_t2m_min = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'t2m_min') 73 type(ctrl_out),save :: o_t2m_max = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'t2m_max') 74 type(ctrl_out),save,dimension(4) :: o_t2m_srf = (/ ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'t2m_ter'), & 75 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'t2m_lic'), & 76 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'t2m_oce'), & 77 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'t2m_sic') /) 78 79 type(ctrl_out),save :: o_wind10m = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'wind10m') 80 type(ctrl_out),save :: o_wind10max = ctrl_out((/ 10, 1, 10, 10, 10, 10 /),'wind10max') 81 type(ctrl_out),save :: o_sicf = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'sicf') 82 type(ctrl_out),save :: o_q2m = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'q2m') 83 type(ctrl_out),save :: o_ustar = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'ustar') 84 type(ctrl_out),save :: o_u10m = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'u10m') 85 type(ctrl_out),save :: o_v10m = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'v10m') 86 type(ctrl_out),save :: o_psol = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'psol') 87 type(ctrl_out),save :: o_qsurf = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'qsurf') 88 89 type(ctrl_out),save,dimension(4) :: o_ustar_srf = (/ ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'ustar_ter'), & 90 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'ustar_lic'), & 91 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'ustar_oce'), & 92 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'ustar_sic') /) 93 type(ctrl_out),save,dimension(4) :: o_u10m_srf = (/ ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'u10m_ter'), & 94 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'u10m_lic'), & 95 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'u10m_oce'), & 96 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'u10m_sic') /) 97 98 type(ctrl_out),save,dimension(4) :: o_v10m_srf = (/ ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'v10m_ter'), & 99 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'v10m_lic'), & 100 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'v10m_oce'), & 101 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'v10m_sic') /) 102 103 type(ctrl_out),save :: o_qsol = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'qsol') 104 105 type(ctrl_out),save :: o_ndayrain = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'ndayrain') 106 type(ctrl_out),save :: o_precip = ctrl_out((/ 1, 1, 1, 10, 5, 10 /),'precip') 107 type(ctrl_out),save :: o_plul = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'plul') 108 109 type(ctrl_out),save :: o_pluc = ctrl_out((/ 1, 1, 1, 10, 5, 10 /),'pluc') 110 type(ctrl_out),save :: o_snow = ctrl_out((/ 1, 1, 10, 10, 5, 10 /),'snow') 111 type(ctrl_out),save :: o_evap = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'evap') 112 type(ctrl_out),save,dimension(4) :: o_evap_srf = (/ ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'evap_ter'), & 113 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'evap_lic'), & 114 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'evap_oce'), & 115 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'evap_sic') /) 116 type(ctrl_out),save :: o_msnow = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'msnow') 117 type(ctrl_out),save :: o_fsnow = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'fsnow') 118 119 type(ctrl_out),save :: o_tops = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'tops') 120 type(ctrl_out),save :: o_tops0 = ctrl_out((/ 1, 5, 10, 10, 10, 10 /),'tops0') 121 type(ctrl_out),save :: o_topl = ctrl_out((/ 1, 1, 10, 5, 10, 10 /),'topl') 122 type(ctrl_out),save :: o_topl0 = ctrl_out((/ 1, 5, 10, 10, 10, 10 /),'topl0') 123 type(ctrl_out),save :: o_SWupTOA = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'SWupTOA') 124 type(ctrl_out),save :: o_SWupTOAclr = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'SWupTOAclr') 125 type(ctrl_out),save :: o_SWdnTOA = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'SWdnTOA') 126 type(ctrl_out),save :: o_SWdnTOAclr = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'SWdnTOAclr') 127 type(ctrl_out),save :: o_nettop = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'nettop') 128 129 type(ctrl_out),save :: o_SWup200 = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'SWup200') 130 type(ctrl_out),save :: o_SWup200clr = ctrl_out((/ 10, 1, 10, 10, 10, 10 /),'SWup200clr') 131 type(ctrl_out),save :: o_SWdn200 = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'SWdn200') 132 type(ctrl_out),save :: o_SWdn200clr = ctrl_out((/ 10, 1, 10, 10, 10, 10 /),'SWdn200clr') 133 134 ! arajouter 135 ! type(ctrl_out),save :: o_LWupTOA = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'LWupTOA') 136 ! type(ctrl_out),save :: o_LWupTOAclr = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'LWupTOAclr') 137 ! type(ctrl_out),save :: o_LWdnTOA = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'LWdnTOA') 138 ! type(ctrl_out),save :: o_LWdnTOAclr = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'LWdnTOAclr') 139 140 type(ctrl_out),save :: o_LWup200 = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'LWup200') 141 type(ctrl_out),save :: o_LWup200clr = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'LWup200clr') 142 type(ctrl_out),save :: o_LWdn200 = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'LWdn200') 143 type(ctrl_out),save :: o_LWdn200clr = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'LWdn200clr') 144 type(ctrl_out),save :: o_sols = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'sols') 145 type(ctrl_out),save :: o_sols0 = ctrl_out((/ 1, 5, 10, 10, 10, 10 /),'sols0') 146 type(ctrl_out),save :: o_soll = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'soll') 147 type(ctrl_out),save :: o_soll0 = ctrl_out((/ 1, 5, 10, 10, 10, 10 /),'soll0') 148 type(ctrl_out),save :: o_radsol = ctrl_out((/ 1, 7, 10, 10, 10, 10 /),'radsol') 149 type(ctrl_out),save :: o_SWupSFC = ctrl_out((/ 1, 4, 10, 10, 5, 10 /),'SWupSFC') 150 type(ctrl_out),save :: o_SWupSFCclr = ctrl_out((/ 1, 4, 10, 10, 5, 10 /),'SWupSFCclr') 151 type(ctrl_out),save :: o_SWdnSFC = ctrl_out((/ 1, 1, 10, 10, 5, 10 /),'SWdnSFC') 152 type(ctrl_out),save :: o_SWdnSFCclr = ctrl_out((/ 1, 4, 10, 10, 5, 10 /),'SWdnSFCclr') 153 type(ctrl_out),save :: o_LWupSFC = ctrl_out((/ 1, 4, 10, 10, 5, 10 /),'LWupSFC') 154 type(ctrl_out),save :: o_LWupSFCclr = ctrl_out((/ 1, 4, 10, 10, 5, 10 /),'LWupSFCclr') 155 type(ctrl_out),save :: o_LWdnSFC = ctrl_out((/ 1, 4, 10, 10, 5, 10 /),'LWdnSFC') 156 type(ctrl_out),save :: o_LWdnSFCclr = ctrl_out((/ 1, 4, 10, 10, 5, 10 /),'LWdnSFCclr') 157 type(ctrl_out),save :: o_bils = ctrl_out((/ 1, 2, 10, 5, 10, 10 /),'bils') 158 type(ctrl_out),save :: o_sens = ctrl_out((/ 1, 1, 10, 10, 5, 10 /),'sens') 159 type(ctrl_out),save :: o_fder = ctrl_out((/ 1, 2, 10, 10, 10, 10 /),'fder') 160 type(ctrl_out),save :: o_ffonte = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'ffonte') 161 type(ctrl_out),save :: o_fqcalving = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'fqcalving') 162 type(ctrl_out),save :: o_fqfonte = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'fqfonte') 163 164 type(ctrl_out),save :: o_taux = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'taux') 165 type(ctrl_out),save :: o_tauy = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'tauy') 166 type(ctrl_out),save,dimension(4) :: o_taux_srf = (/ ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'taux_ter'), & 167 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'taux_lic'), & 168 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'taux_oce'), & 169 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'taux_sic') /) 170 171 type(ctrl_out),save,dimension(4) :: o_tauy_srf = (/ ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'tauy_ter'), & 172 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'tauy_lic'), & 173 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'tauy_oce'), & 174 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'tauy_sic') /) 175 176 177 type(ctrl_out),save,dimension(4) :: o_pourc_srf = (/ ctrl_out((/ 1, 7, 10, 10, 10, 10 /),'pourc_ter'), & 178 ctrl_out((/ 1, 7, 10, 10, 10, 10 /),'pourc_lic'), & 179 ctrl_out((/ 1, 7, 10, 10, 10, 10 /),'pourc_oce'), & 180 ctrl_out((/ 1, 7, 10, 10, 10, 10 /),'pourc_sic') /) 181 182 type(ctrl_out),save,dimension(4) :: o_fract_srf = (/ ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'fract_ter'), & 183 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'fract_lic'), & 184 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'fract_oce'), & 185 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'fract_sic') /) 186 187 type(ctrl_out),save,dimension(4) :: o_tsol_srf = (/ ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'tsol_ter'), & 188 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'tsol_lic'), & 189 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'tsol_oce'), & 190 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'tsol_sic') /) 191 192 type(ctrl_out),save,dimension(4) :: o_evappot_srf = (/ ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'evappot_ter'), & 193 ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'evappot_lic'), & 194 ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'evappot_oce'), & 195 ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'evappot_sic') /) 196 197 type(ctrl_out),save,dimension(4) :: o_sens_srf = (/ ctrl_out((/ 1, 6, 10, 7, 10, 10 /),'sens_ter'), & 198 ctrl_out((/ 1, 6, 10, 7, 10, 10 /),'sens_lic'), & 199 ctrl_out((/ 1, 6, 10, 7, 10, 10 /),'sens_oce'), & 200 ctrl_out((/ 1, 6, 10, 7, 10, 10 /),'sens_sic') /) 201 202 type(ctrl_out),save,dimension(4) :: o_lat_srf = (/ ctrl_out((/ 1, 6, 10, 7, 10, 10 /),'lat_ter'), & 203 ctrl_out((/ 1, 6, 10, 7, 10, 10 /),'lat_lic'), & 204 ctrl_out((/ 1, 6, 10, 7, 10, 10 /),'lat_oce'), & 205 ctrl_out((/ 1, 6, 10, 7, 10, 10 /),'lat_sic') /) 206 207 type(ctrl_out),save,dimension(4) :: o_flw_srf = (/ ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'flw_ter'), & 208 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'flw_lic'), & 209 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'flw_oce'), & 210 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'flw_sic') /) 211 212 type(ctrl_out),save,dimension(4) :: o_fsw_srf = (/ ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'fsw_ter'), & 213 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'fsw_lic'), & 214 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'fsw_oce'), & 215 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'fsw_sic') /) 216 217 type(ctrl_out),save,dimension(4) :: o_wbils_srf = (/ ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbils_ter'), & 218 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbils_lic'), & 219 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbils_oce'), & 220 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbils_sic') /) 221 222 type(ctrl_out),save,dimension(4) :: o_wbilo_srf = (/ ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbilo_ter'), & 223 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbilo_lic'), & 224 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbilo_oce'), & 225 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbilo_sic') /) 226 227 228 type(ctrl_out),save :: o_cdrm = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'cdrm') 229 type(ctrl_out),save :: o_cdrh = ctrl_out((/ 1, 10, 10, 7, 10, 10 /),'cdrh') 230 type(ctrl_out),save :: o_cldl = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'cldl') 231 type(ctrl_out),save :: o_cldm = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'cldm') 232 type(ctrl_out),save :: o_cldh = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'cldh') 233 type(ctrl_out),save :: o_cldt = ctrl_out((/ 1, 1, 2, 10, 5, 10 /),'cldt') 234 type(ctrl_out),save :: o_cldq = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'cldq') 235 type(ctrl_out),save :: o_lwp = ctrl_out((/ 1, 5, 10, 10, 10, 10 /),'lwp') 236 type(ctrl_out),save :: o_iwp = ctrl_out((/ 1, 5, 10, 10, 10, 10 /),'iwp') 237 type(ctrl_out),save :: o_ue = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'ue') 238 type(ctrl_out),save :: o_ve = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'ve') 239 type(ctrl_out),save :: o_uq = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'uq') 240 type(ctrl_out),save :: o_vq = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'vq') 241 242 type(ctrl_out),save :: o_cape = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'cape') 243 type(ctrl_out),save :: o_pbase = ctrl_out((/ 1, 5, 10, 10, 10, 10 /),'pbase') 244 type(ctrl_out),save :: o_ptop = ctrl_out((/ 1, 5, 10, 10, 10, 10 /),'ptop') 245 type(ctrl_out),save :: o_fbase = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'fbase') 246 type(ctrl_out),save :: o_plcl = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'plcl') 247 type(ctrl_out),save :: o_plfc = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'plfc') 248 type(ctrl_out),save :: o_wbeff = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbeff') 249 type(ctrl_out),save :: o_prw = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'prw') 250 251 type(ctrl_out),save :: o_s_pblh = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_pblh') 252 type(ctrl_out),save :: o_s_pblt = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_pblt') 253 type(ctrl_out),save :: o_s_lcl = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_lcl') 254 type(ctrl_out),save :: o_s_therm = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_therm') 255 !IM : Les champs suivants (s_capCL, s_oliqCL, s_cteiCL, s_trmb1, s_trmb2, s_trmb3) ne sont pas definis dans HBTM.F 256 ! type(ctrl_out),save :: o_s_capCL = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_capCL') 257 ! type(ctrl_out),save :: o_s_oliqCL = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_oliqCL') 258 ! type(ctrl_out),save :: o_s_cteiCL = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_cteiCL') 259 ! type(ctrl_out),save :: o_s_trmb1 = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_trmb1') 260 ! type(ctrl_out),save :: o_s_trmb2 = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_trmb2') 261 ! type(ctrl_out),save :: o_s_trmb3 = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_trmb3') 262 263 type(ctrl_out),save :: o_slab_bils = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'slab_bils_oce') 264 265 type(ctrl_out),save :: o_ale_bl = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'ale_bl') 266 type(ctrl_out),save :: o_alp_bl = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl') 267 type(ctrl_out),save :: o_ale_wk = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'ale_wk') 268 type(ctrl_out),save :: o_alp_wk = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_wk') 269 270 type(ctrl_out),save :: o_ale = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'ale') 271 type(ctrl_out),save :: o_alp = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp') 272 type(ctrl_out),save :: o_cin = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'cin') 273 type(ctrl_out),save :: o_wape = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'wape') 274 275 !!! nrlmd le 10/04/2012 276 277 !-------Spectre de thermiques de type 2 au LCL 278 type(ctrl_out),save :: o_n2 = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'n2') 279 type(ctrl_out),save :: o_s2 = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'s2') 280 281 !-------Déclenchement stochastique 282 type(ctrl_out),save :: o_proba_notrig = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'proba_notrig') 283 type(ctrl_out),save :: o_random_notrig = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'random_notrig') 284 type(ctrl_out),save :: o_ale_bl_stat = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'ale_bl_stat') 285 type(ctrl_out),save :: o_ale_bl_trig = ctrl_out((/ 1, 1, 1, 6, 10, 10 /),'ale_bl_trig') 286 287 !-------Fermeture statistique 288 type(ctrl_out),save :: o_alp_bl_det = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl_det') 289 type(ctrl_out),save :: o_alp_bl_fluct_m = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl_fluct_m') 290 type(ctrl_out),save :: o_alp_bl_fluct_tke = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl_fluct_tke') 291 type(ctrl_out),save :: o_alp_bl_conv = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl_conv') 292 type(ctrl_out),save :: o_alp_bl_stat = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl_stat') 293 294 !!! fin nrlmd le 10/04/2012 295 296 ! Champs interpolles sur des niveaux de pression ??? a faire correctement 297 298 type(ctrl_out),save,dimension(7) :: o_uSTDlevs = (/ ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'u850'), & 299 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'u700'), & 300 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'u500'), & 301 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'u200'), & 302 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'u100'), & 303 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'u50'), & 304 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'u10') /) 305 306 307 type(ctrl_out),save,dimension(7) :: o_vSTDlevs = (/ ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'v850'), & 308 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'v700'), & 309 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'v500'), & 310 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'v200'), & 311 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'v100'), & 312 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'v50'), & 313 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'v10') /) 314 315 type(ctrl_out),save,dimension(7) :: o_wSTDlevs = (/ ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'w850'), & 316 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'w700'), & 317 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'w500'), & 318 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'w200'), & 319 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'w100'), & 320 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'w50'), & 321 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'w10') /) 322 323 type(ctrl_out),save,dimension(7) :: o_tSTDlevs = (/ ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'t850'), & 324 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'t700'), & 325 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'t500'), & 326 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'t200'), & 327 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'t100'), & 328 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'t50'), & 329 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'t10') /) 330 331 type(ctrl_out),save,dimension(7) :: o_qSTDlevs = (/ ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'q850'), & 332 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'q700'), & 333 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'q500'), & 334 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'q200'), & 335 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'q100'), & 336 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'q50'), & 337 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'q10') /) 338 339 type(ctrl_out),save,dimension(7) :: o_zSTDlevs = (/ ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'z850'), & 340 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'z700'), & 341 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'z500'), & 342 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'z200'), & 343 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'z100'), & 344 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'z50'), & 345 ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'z10') /) 346 347 348 type(ctrl_out),save :: o_t_oce_sic = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'t_oce_sic') 349 350 type(ctrl_out),save :: o_weakinv = ctrl_out((/ 10, 1, 10, 10, 10, 10 /),'weakinv') 351 type(ctrl_out),save :: o_dthmin = ctrl_out((/ 10, 1, 10, 10, 10, 10 /),'dthmin') 352 type(ctrl_out),save,dimension(4) :: o_u10_srf = (/ ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'u10_ter'), & 353 ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'u10_lic'), & 354 ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'u10_oce'), & 355 ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'u10_sic') /) 356 357 type(ctrl_out),save,dimension(4) :: o_v10_srf = (/ ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'v10_ter'), & 358 ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'v10_lic'), & 359 ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'v10_oce'), & 360 ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'v10_sic') /) 361 362 type(ctrl_out),save :: o_cldtau = ctrl_out((/ 10, 5, 10, 10, 10, 10 /),'cldtau') 363 type(ctrl_out),save :: o_cldemi = ctrl_out((/ 10, 5, 10, 10, 10, 10 /),'cldemi') 364 type(ctrl_out),save :: o_rh2m = ctrl_out((/ 5, 5, 10, 10, 10, 10 /),'rh2m') 365 type(ctrl_out),save :: o_rh2m_min = ctrl_out((/ 10, 5, 10, 10, 10, 10 /),'rh2m_min') 366 type(ctrl_out),save :: o_rh2m_max = ctrl_out((/ 10, 5, 10, 10, 10, 10 /),'rh2m_max') 367 type(ctrl_out),save :: o_qsat2m = ctrl_out((/ 10, 5, 10, 10, 10, 10 /),'qsat2m') 368 type(ctrl_out),save :: o_tpot = ctrl_out((/ 10, 5, 10, 10, 10, 10 /),'tpot') 369 type(ctrl_out),save :: o_tpote = ctrl_out((/ 10, 5, 10, 10, 10, 10 /),'tpote') 370 type(ctrl_out),save :: o_tke = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tke ') 371 type(ctrl_out),save :: o_tke_max = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tke_max') 372 373 type(ctrl_out),save,dimension(4) :: o_tke_srf = (/ ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'tke_ter'), & 374 ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'tke_lic'), & 375 ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'tke_oce'), & 376 ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'tke_sic') /) 377 378 type(ctrl_out),save,dimension(4) :: o_tke_max_srf = (/ ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'tke_max_ter'), & 379 ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'tke_max_lic'), & 380 ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'tke_max_oce'), & 381 ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'tke_max_sic') /) 382 383 type(ctrl_out),save :: o_kz = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'kz') 384 type(ctrl_out),save :: o_kz_max = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'kz_max') 385 type(ctrl_out),save :: o_SWnetOR = ctrl_out((/ 10, 10, 2, 10, 10, 10 /),'SWnetOR') 386 type(ctrl_out),save :: o_SWdownOR = ctrl_out((/ 10, 10, 2, 10, 10, 10 /),'SWdownOR') 387 type(ctrl_out),save :: o_LWdownOR = ctrl_out((/ 10, 10, 2, 10, 10, 10 /),'LWdownOR') 388 389 type(ctrl_out),save :: o_snowl = ctrl_out((/ 10, 1, 10, 10, 10, 10 /),'snowl') 390 type(ctrl_out),save :: o_cape_max = ctrl_out((/ 10, 1, 10, 10, 10, 10 /),'cape_max') 391 type(ctrl_out),save :: o_solldown = ctrl_out((/ 10, 1, 10, 10, 10, 10 /),'solldown') 392 393 type(ctrl_out),save :: o_dtsvdfo = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'dtsvdfo') 394 type(ctrl_out),save :: o_dtsvdft = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'dtsvdft') 395 type(ctrl_out),save :: o_dtsvdfg = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'dtsvdfg') 396 type(ctrl_out),save :: o_dtsvdfi = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'dtsvdfi') 397 type(ctrl_out),save :: o_rugs = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'rugs') 398 399 type(ctrl_out),save :: o_topswad = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'topswad') 400 type(ctrl_out),save :: o_topswad0 = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'topswad0') 401 type(ctrl_out),save :: o_topswai = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'topswai') 402 type(ctrl_out),save :: o_solswad = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'solswad') 403 type(ctrl_out),save :: o_solswad0 = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'solswad0') 404 type(ctrl_out),save :: o_solswai = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'solswai') 405 406 type(ctrl_out),save,dimension(10) :: o_tausumaero = (/ ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_ASBCM'), & 407 ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_ASPOMM'), & 408 ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_ASSO4M'), & 409 ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_CSSO4M'), & 410 ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_SSSSM'), & 411 ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_ASSSM'), & 412 ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_CSSSM'), & 413 ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_CIDUSTM'), & 414 ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_AIBCM'), & 415 ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_AIPOMM') /) 416 417 type(ctrl_out),save :: o_od550aer = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'od550aer') 418 type(ctrl_out),save :: o_od865aer = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'od865aer') 419 type(ctrl_out),save :: o_absvisaer = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'absvisaer') 420 type(ctrl_out),save :: o_od550lt1aer = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'od550lt1aer') 421 422 type(ctrl_out),save :: o_sconcso4 = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'sconcso4') 423 type(ctrl_out),save :: o_sconcoa = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'sconcoa') 424 type(ctrl_out),save :: o_sconcbc = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'sconcbc') 425 type(ctrl_out),save :: o_sconcss = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'sconcss') 426 type(ctrl_out),save :: o_sconcdust = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'sconcdust') 427 type(ctrl_out),save :: o_concso4 = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'concso4') 428 type(ctrl_out),save :: o_concoa = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'concoa') 429 type(ctrl_out),save :: o_concbc = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'concbc') 430 type(ctrl_out),save :: o_concss = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'concss') 431 type(ctrl_out),save :: o_concdust = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'concdust') 432 type(ctrl_out),save :: o_loadso4 = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'loadso4') 433 type(ctrl_out),save :: o_loadoa = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'loadoa') 434 type(ctrl_out),save :: o_loadbc = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'loadbc') 435 type(ctrl_out),save :: o_loadss = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'loadss') 436 type(ctrl_out),save :: o_loaddust = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'loaddust') 437 438 type(ctrl_out),save :: o_swtoaas_nat = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swtoaas_nat') 439 type(ctrl_out),save :: o_swsrfas_nat = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swsrfas_nat') 440 type(ctrl_out),save :: o_swtoacs_nat = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swtoacs_nat') 441 type(ctrl_out),save :: o_swsrfcs_nat = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swsrfcs_nat') 442 443 type(ctrl_out),save :: o_swtoaas_ant = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swtoaas_ant') 444 type(ctrl_out),save :: o_swsrfas_ant = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swsrfas_ant') 445 type(ctrl_out),save :: o_swtoacs_ant = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swtoacs_ant') 446 type(ctrl_out),save :: o_swsrfcs_ant = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swsrfcs_ant') 447 448 type(ctrl_out),save :: o_swtoacf_nat = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swtoacf_nat') 449 type(ctrl_out),save :: o_swsrfcf_nat = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swsrfcf_nat') 450 type(ctrl_out),save :: o_swtoacf_ant = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swtoacf_ant') 451 type(ctrl_out),save :: o_swsrfcf_ant = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swsrfcf_ant') 452 type(ctrl_out),save :: o_swtoacf_zero = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swtoacf_zero') 453 type(ctrl_out),save :: o_swsrfcf_zero = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swsrfcf_zero') 454 455 type(ctrl_out),save :: o_cldncl = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'cldncl') 456 type(ctrl_out),save :: o_reffclwtop = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'reffclwtop') 457 type(ctrl_out),save :: o_cldnvi = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'cldnvi') 458 type(ctrl_out),save :: o_lcc = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'lcc') 459 460 461 !!!!!!!!!!!!!!!!!!!!!! 3D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 462 type(ctrl_out),save :: o_ec550aer = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'ec550aer') 463 type(ctrl_out),save :: o_lwcon = ctrl_out((/ 2, 5, 10, 10, 10, 10 /),'lwcon') 464 type(ctrl_out),save :: o_iwcon = ctrl_out((/ 2, 5, 10, 10, 10, 10 /),'iwcon') 465 type(ctrl_out),save :: o_temp = ctrl_out((/ 2, 3, 4, 10, 10, 10 /),'temp') 466 type(ctrl_out),save :: o_theta = ctrl_out((/ 2, 3, 4, 10, 10, 10 /),'theta') 467 type(ctrl_out),save :: o_ovap = ctrl_out((/ 2, 3, 4, 10, 10, 10 /),'ovap') 468 type(ctrl_out),save :: o_ovapinit = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'ovapinit') 469 type(ctrl_out),save :: o_oliq = ctrl_out((/ 2, 3, 4, 10, 10, 10 /),'oliq') 470 type(ctrl_out),save :: o_wvapp = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'wvapp') 471 type(ctrl_out),save :: o_geop = ctrl_out((/ 2, 3, 10, 10, 10, 10 /),'geop') 472 type(ctrl_out),save :: o_vitu = ctrl_out((/ 2, 3, 4, 6, 10, 10 /),'vitu') 473 type(ctrl_out),save :: o_vitv = ctrl_out((/ 2, 3, 4, 6, 10, 10 /),'vitv') 474 type(ctrl_out),save :: o_vitw = ctrl_out((/ 2, 3, 10, 6, 10, 10 /),'vitw') 475 type(ctrl_out),save :: o_pres = ctrl_out((/ 2, 3, 10, 10, 10, 10 /),'pres') 476 type(ctrl_out),save :: o_paprs = ctrl_out((/ 2, 3, 10, 10, 10, 10 /),'paprs') 477 type(ctrl_out),save :: o_mass = ctrl_out((/ 2, 3, 10, 10, 10, 10 /),'mass') 478 type(ctrl_out),save :: o_zfull = ctrl_out((/ 2, 3, 10, 10, 10, 10 /),'zfull') 479 type(ctrl_out),save :: o_zhalf = ctrl_out((/ 2, 3, 10, 10, 10, 10 /),'zhalf') 480 type(ctrl_out),save :: o_rneb = ctrl_out((/ 2, 5, 10, 10, 10, 10 /),'rneb') 481 type(ctrl_out),save :: o_rnebcon = ctrl_out((/ 2, 5, 10, 10, 10, 10 /),'rnebcon') 482 type(ctrl_out),save :: o_rnebls = ctrl_out((/ 2, 5, 10, 10, 10, 10 /),'rnebls') 483 type(ctrl_out),save :: o_rhum = ctrl_out((/ 2, 5, 10, 10, 10, 10 /),'rhum') 484 type(ctrl_out),save :: o_ozone = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'ozone') 485 type(ctrl_out),save :: o_ozone_light = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'ozone_daylight') 486 type(ctrl_out),save :: o_upwd = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'upwd') 487 type(ctrl_out),save :: o_dtphy = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'dtphy') 488 type(ctrl_out),save :: o_dqphy = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'dqphy') 489 type(ctrl_out),save :: o_pr_con_l = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'pr_con_l') 490 type(ctrl_out),save :: o_pr_con_i = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'pr_con_i') 491 type(ctrl_out),save :: o_pr_lsc_l = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'pr_lsc_l') 492 type(ctrl_out),save :: o_pr_lsc_i = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'pr_lsc_i') 493 type(ctrl_out),save :: o_re = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'re') 494 type(ctrl_out),save :: o_fl = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'fl') 495 type(ctrl_out),save :: o_scdnc = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'scdnc') 496 type(ctrl_out),save :: o_reffclws = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'reffclws') 497 type(ctrl_out),save :: o_reffclwc = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'reffclwc') 498 type(ctrl_out),save :: o_lcc3d = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'lcc3d') 499 type(ctrl_out),save :: o_lcc3dcon = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'lcc3dcon') 500 type(ctrl_out),save :: o_lcc3dstra = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'lcc3dstra') 501 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 502 503 type(ctrl_out),save,dimension(4) :: o_albe_srf = (/ ctrl_out((/ 3, 7, 10, 7, 10, 10 /),'albe_ter'), & 504 ctrl_out((/ 3, 7, 10, 7, 10, 10 /),'albe_lic'), & 505 ctrl_out((/ 3, 7, 10, 7, 10, 10 /),'albe_oce'), & 506 ctrl_out((/ 3, 7, 10, 7, 10, 10 /),'albe_sic') /) 507 508 type(ctrl_out),save,dimension(4) :: o_ages_srf = (/ ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'ages_ter'), & 509 ctrl_out((/ 3, 10, 10, 10, 10, 10 /),'ages_lic'), & 510 ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'ages_oce'), & 511 ctrl_out((/ 3, 10, 10, 10, 10, 10 /),'ages_sic') /) 512 513 type(ctrl_out),save,dimension(4) :: o_rugs_srf = (/ ctrl_out((/ 3, 6, 10, 10, 10, 10 /),'rugs_ter'), & 514 ctrl_out((/ 3, 6, 10, 10, 10, 10 /),'rugs_lic'), & 515 ctrl_out((/ 3, 6, 10, 10, 10, 10 /),'rugs_oce'), & 516 ctrl_out((/ 3, 6, 10, 10, 10, 10 /),'rugs_sic') /) 517 518 type(ctrl_out),save :: o_alb1 = ctrl_out((/ 3, 10, 10, 10, 10, 10 /),'alb1') 519 type(ctrl_out),save :: o_alb2 = ctrl_out((/ 3, 10, 10, 10, 10, 10 /),'alb2') 520 521 type(ctrl_out),save :: o_clwcon = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'clwcon') 522 type(ctrl_out),save :: o_Ma = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'Ma') 523 type(ctrl_out),save :: o_dnwd = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dnwd') 524 type(ctrl_out),save :: o_dnwd0 = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dnwd0') 525 type(ctrl_out),save :: o_mc = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'mc') 526 type(ctrl_out),save :: o_ftime_con = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ftime_con') 527 type(ctrl_out),save :: o_dtdyn = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtdyn') 528 type(ctrl_out),save :: o_dqdyn = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqdyn') 529 type(ctrl_out),save :: o_dudyn = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dudyn') !AXC 530 type(ctrl_out),save :: o_dvdyn = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dvdyn') !AXC 531 type(ctrl_out),save :: o_dtcon = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtcon') 532 type(ctrl_out),save :: o_ducon = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ducon') 533 type(ctrl_out),save :: o_dvcon = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dvcon') 534 type(ctrl_out),save :: o_dqcon = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqcon') 535 type(ctrl_out),save :: o_dtwak = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'dtwak') 536 type(ctrl_out),save :: o_dqwak = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'dqwak') 537 type(ctrl_out),save :: o_wake_h = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'wake_h') 538 type(ctrl_out),save :: o_wake_s = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'wake_s') 539 type(ctrl_out),save :: o_wake_deltat = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'wake_deltat') 540 type(ctrl_out),save :: o_wake_deltaq = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'wake_deltaq') 541 type(ctrl_out),save :: o_wake_omg = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'wake_omg') 542 type(ctrl_out),save :: o_wdtrainA = ctrl_out((/ 4, 1, 10, 4, 1, 10 /),'wdtrainA') !<<RomP 543 type(ctrl_out),save :: o_wdtrainM = ctrl_out((/ 4, 1, 10, 4, 1, 10 /),'wdtrainM') !<<RomP 544 type(ctrl_out),save :: o_Vprecip = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'Vprecip') 545 type(ctrl_out),save :: o_ftd = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'ftd') 546 type(ctrl_out),save :: o_fqd = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'fqd') 547 type(ctrl_out),save :: o_dtlsc = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtlsc') 548 type(ctrl_out),save :: o_dtlschr = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtlschr') 549 type(ctrl_out),save :: o_dqlsc = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqlsc') 550 type(ctrl_out),save :: o_beta_prec = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'beta_prec') 551 type(ctrl_out),save :: o_dtvdf = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtvdf') 552 type(ctrl_out),save :: o_dqvdf = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqvdf') 553 type(ctrl_out),save :: o_dteva = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dteva') 554 type(ctrl_out),save :: o_dqeva = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqeva') 555 556 !!!!!!!!!!!!!!!! Specifique thermiques 557 type(ctrl_out),save :: o_dqlscth = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'dqlscth') 558 type(ctrl_out),save :: o_dqlscst = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'dqlscst') 559 type(ctrl_out),save :: o_dtlscth = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'dtlscth') 560 type(ctrl_out),save :: o_dtlscst = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'dtlscst') 561 type(ctrl_out),save :: o_plulth = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'plulth') 562 type(ctrl_out),save :: o_plulst = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'plulst') 563 type(ctrl_out),save :: o_lmaxth = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'lmaxth') 564 type(ctrl_out),save :: o_ptconvth = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'ptconvth') 565 !!!!!!!!!!!!!!!!!!!!!!!! 566 567 568 type(ctrl_out),save :: o_ptconv = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ptconv') 569 type(ctrl_out),save :: o_ratqs = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ratqs') 570 type(ctrl_out),save :: o_dtthe = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtthe') 571 type(ctrl_out),save :: o_f_th = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'f_th') 572 type(ctrl_out),save :: o_e_th = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'e_th') 573 type(ctrl_out),save :: o_w_th = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'w_th') 574 type(ctrl_out),save :: o_ftime_th = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ftime_th') 575 type(ctrl_out),save :: o_q_th = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'q_th') 576 type(ctrl_out),save :: o_a_th = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'a_th') 577 type(ctrl_out),save :: o_d_th = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'d_th') 578 type(ctrl_out),save :: o_f0_th = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'f0_th') 579 type(ctrl_out),save :: o_zmax_th = ctrl_out((/ 4, 4, 4, 5, 10, 10 /),'zmax_th') 580 type(ctrl_out),save :: o_dqthe = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqthe') 581 type(ctrl_out),save :: o_dtajs = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtajs') 582 type(ctrl_out),save :: o_dqajs = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqajs') 583 type(ctrl_out),save :: o_dtswr = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtswr') 584 type(ctrl_out),save :: o_dtsw0 = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtsw0') 585 type(ctrl_out),save :: o_dtlwr = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtlwr') 586 type(ctrl_out),save :: o_dtlw0 = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtlw0') 587 type(ctrl_out),save :: o_dtec = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtec') 588 type(ctrl_out),save :: o_duvdf = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'duvdf') 589 type(ctrl_out),save :: o_dvvdf = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dvvdf') 590 type(ctrl_out),save :: o_duoro = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'duoro') 591 type(ctrl_out),save :: o_dvoro = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dvoro') 592 type(ctrl_out),save :: o_dulif = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dulif') 593 type(ctrl_out),save :: o_dvlif = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dvlif') 594 type(ctrl_out),save :: o_duhin = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'duhin') 595 type(ctrl_out),save :: o_dvhin = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dvhin') 596 type(ctrl_out),save :: o_dtoro = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtoro') 597 type(ctrl_out),save :: o_dtlif = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtlif') 598 type(ctrl_out),save :: o_dthin = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dthin') 599 600 type(ctrl_out),save,allocatable :: o_trac(:) 601 type(ctrl_out),save,allocatable :: o_trac_cum(:) 602 603 type(ctrl_out),save :: o_rsu = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rsu') 604 type(ctrl_out),save :: o_rsd = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rsd') 605 type(ctrl_out),save :: o_rlu = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rlu') 606 type(ctrl_out),save :: o_rld = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rld') 607 type(ctrl_out),save :: o_rsucs = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rsucs') 608 type(ctrl_out),save :: o_rsdcs = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rsdcs') 609 type(ctrl_out),save :: o_rlucs = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rlucs') 610 type(ctrl_out),save :: o_rldcs = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rldcs') 611 612 type(ctrl_out),save :: o_tnt = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tnt') 613 type(ctrl_out),save :: o_tntc = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tntc') 614 type(ctrl_out),save :: o_tntr = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tntr') 615 type(ctrl_out),save :: o_tntscpbl = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tntscpbl') 616 617 type(ctrl_out),save :: o_tnhus = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tnhus') 618 type(ctrl_out),save :: o_tnhusc = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tnhusc') 619 type(ctrl_out),save :: o_tnhusscpbl = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tnhusscpbl') 620 621 type(ctrl_out),save :: o_evu = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'evu') 622 623 type(ctrl_out),save :: o_h2o = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'h2o') 624 625 type(ctrl_out),save :: o_mcd = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'mcd') 626 type(ctrl_out),save :: o_dmc = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dmc') 627 type(ctrl_out),save :: o_ref_liq = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ref_liq') 628 type(ctrl_out),save :: o_ref_ice = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ref_ice') 629 630 type(ctrl_out),save :: o_rsut4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rsut4co2') 631 type(ctrl_out),save :: o_rlut4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rlut4co2') 632 type(ctrl_out),save :: o_rsutcs4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rsutcs4co2') 633 type(ctrl_out),save :: o_rlutcs4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rlutcs4co2') 634 635 type(ctrl_out),save :: o_rsu4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rsu4co2') 636 type(ctrl_out),save :: o_rlu4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rlu4co2') 637 type(ctrl_out),save :: o_rsucs4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rsucs4co2') 638 type(ctrl_out),save :: o_rlucs4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rlucs4co2') 639 type(ctrl_out),save :: o_rsd4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rsd4co2') 640 type(ctrl_out),save :: o_rld4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rld4co2') 641 type(ctrl_out),save :: o_rsdcs4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rsdcs4co2') 642 type(ctrl_out),save :: o_rldcs4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rldcs4co2') 20 PRIVATE histdef2d, histdef3d, conf_physoutputs 21 22 REAL, PRIVATE, SAVE :: zdtime 23 !$OMP THREADPRIVATE(zdtime) 24 643 25 644 26 … … 656 38 ok_hf,ok_instan,ok_LES,ok_ade,ok_aie, read_climoz, & 657 39 phys_out_filestations, & 658 new_aod, aerosol_couple )40 new_aod, aerosol_couple, flag_aerosol_strat) 659 41 660 42 USE iophy … … 669 51 include "dimensions.h" 670 52 include "temps.h" 671 include "indicesol.h"672 53 include "clesphys.h" 673 54 include "thermcell.h" … … 677 58 real,dimension(klon),intent(in) :: rlon 678 59 real,dimension(klon),intent(in) :: rlat 679 integer, intent(in) :: pim60 INTEGER, intent(in) :: pim 680 61 INTEGER, DIMENSION(pim) :: tabij 681 62 INTEGER,dimension(pim), intent(in) :: ipt, jpt … … 683 64 REAL,dimension(pim,2) :: plat_bounds, plon_bounds 684 65 685 integer:: jjmp1686 integer:: nbteta, nlevSTD, radpas687 logical:: ok_mensuel, ok_journe, ok_hf, ok_instan688 logical :: ok_LES,ok_ade,ok_aie689 logical:: new_aod, aerosol_couple690 integer, intent(in):: read_climoz ! read ozone climatology66 INTEGER :: jjmp1 67 INTEGER :: nbteta, nlevSTD, radpas 68 LOGICAL :: ok_mensuel, ok_journe, ok_hf, ok_instan 69 LOGICAL :: ok_LES,ok_ade,ok_aie,flag_aerosol_strat 70 LOGICAL :: new_aod, aerosol_couple 71 INTEGER, intent(in):: read_climoz ! read ozone climatology 691 72 ! Allowed values are 0, 1 and 2 692 73 ! 0: do not read an ozone climatology … … 695 76 ! climatology and the daylight climatology 696 77 697 real :: dtime 698 integer :: idayref 699 real :: zjulian 700 real, dimension(klev) :: Ahyb, Bhyb, Alt 701 character(len=4), dimension(nlevSTD) :: clevSTD 702 integer :: nsrf, k, iq, iiq, iff, i, j, ilev 703 integer :: naero 704 logical :: ok_veget 705 integer :: iflag_pbl 706 CHARACTER(len=4) :: bb2 707 CHARACTER(len=2) :: bb3 708 character(len=6) :: type_ocean 709 CHARACTER(len=3) :: ctetaSTD(nbteta) 710 real, dimension(nfiles) :: ecrit_files 711 CHARACTER(len=20), dimension(nfiles) :: phys_out_filenames 712 INTEGER, dimension(iim*jjmp1) :: ndex2d 713 INTEGER, dimension(iim*jjmp1*klev) :: ndex3d 714 integer :: imin_ins, imax_ins 715 integer :: jmin_ins, jmax_ins 716 integer, dimension(nfiles) :: phys_out_levmin, phys_out_levmax 717 integer, dimension(nfiles) :: phys_out_filelevels 718 CHARACTER(len=20), dimension(nfiles) :: type_ecri_files, phys_out_filetypes 719 character(len=20), dimension(nfiles) :: chtimestep = (/ 'DefFreq', 'DefFreq','DefFreq', 'DefFreq', 'DefFreq', 'DefFreq' /) 720 logical, dimension(nfiles) :: phys_out_filekeys 721 logical, dimension(nfiles) :: phys_out_filestations 78 REAL :: dtime 79 INTEGER :: idayref 80 REAL :: zjulian 81 REAL, DIMENSION(klev) :: Ahyb, Bhyb, Alt 82 CHARACTER(LEN=4), DIMENSION(nlevSTD) :: clevSTD 83 INTEGER :: nsrf, k, iq, iiq, iff, i, j, ilev 84 INTEGER :: naero 85 LOGICAL :: ok_veget 86 INTEGER :: iflag_pbl 87 CHARACTER(LEN=4) :: bb2 88 CHARACTER(LEN=2) :: bb3 89 CHARACTER(LEN=6) :: type_ocean 90 CHARACTER(LEN=3) :: ctetaSTD(nbteta) 91 REAL, DIMENSION(nfiles) :: ecrit_files 92 CHARACTER(LEN=20), DIMENSION(nfiles) :: phys_out_filenames 93 INTEGER, DIMENSION(iim*jjmp1) :: ndex2d 94 INTEGER, DIMENSION(iim*jjmp1*klev) :: ndex3d 95 INTEGER :: imin_ins, imax_ins 96 INTEGER :: jmin_ins, jmax_ins 97 INTEGER, DIMENSION(nfiles) :: phys_out_levmin, phys_out_levmax 98 INTEGER, DIMENSION(nfiles) :: phys_out_filelevels 99 CHARACTER(LEN=20), DIMENSION(nfiles) :: chtimestep = (/ 'DefFreq', 'DefFreq','DefFreq', 'DefFreq', 'DefFreq', 'DefFreq' /) 100 LOGICAL, DIMENSION(nfiles) :: phys_out_filekeys 101 LOGICAL, DIMENSION(nfiles) :: phys_out_filestations 722 102 723 103 !!!!!!!!!! stockage dans une region limitee pour chaque fichier !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 724 104 ! entre [phys_out_lonmin,phys_out_lonmax] et [phys_out_latmin,phys_out_latmax] 725 105 726 logical, dimension(nfiles), save :: phys_out_regfkey = (/ .false., .false., .false., .false., .false., .false. /)727 real, dimension(nfiles), save:: phys_out_lonmin = (/ -180., -180., -180., -180., -180., -180. /)728 real, dimension(nfiles), save:: phys_out_lonmax = (/ 180., 180., 180., 180., 180., 180. /)729 real, dimension(nfiles), save:: phys_out_latmin = (/ -90., -90., -90., -90., -90., -90. /)730 real, dimension(nfiles), save:: phys_out_latmax = (/ 90., 90., 90., 90., 90., 90. /)731 732 write(lunout,*) 'Debut phys_output_mod.F90'106 LOGICAL, DIMENSION(nfiles), SAVE :: phys_out_regfkey = (/ .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /) 107 REAL, DIMENSION(nfiles), SAVE :: phys_out_lonmin = (/ -180., -180., -180., -180., -180., -180. /) 108 REAL, DIMENSION(nfiles), SAVE :: phys_out_lonmax = (/ 180., 180., 180., 180., 180., 180. /) 109 REAL, DIMENSION(nfiles), SAVE :: phys_out_latmin = (/ -90., -90., -90., -90., -90., -90. /) 110 REAL, DIMENSION(nfiles), SAVE :: phys_out_latmax = (/ 90., 90., 90., 90., 90., 90. /) 111 112 WRITE(lunout,*) 'Debut phys_output_mod.F90' 733 113 ! Initialisations (Valeurs par defaut 734 114 735 if (.not. allocated(o_trac)) ALLOCATE(o_trac(nqtot))736 if (.not. allocated(o_trac_cum)) ALLOCATE(o_trac_cum(nqtot))115 IF (.NOT. ALLOCATED(o_trac)) ALLOCATE(o_trac(nqtot)) 116 IF (.NOT. ALLOCATED(o_trac_cum)) ALLOCATE(o_trac_cum(nqtot)) 737 117 738 118 levmax = (/ klev, klev, klev, klev, klev, klev /) … … 783 163 !! Lectures des parametres de sorties dans physiq.def 784 164 785 callgetin('phys_out_regfkey',phys_out_regfkey)786 callgetin('phys_out_lonmin',phys_out_lonmin)787 callgetin('phys_out_lonmax',phys_out_lonmax)788 callgetin('phys_out_latmin',phys_out_latmin)789 callgetin('phys_out_latmax',phys_out_latmax)165 CALL getin('phys_out_regfkey',phys_out_regfkey) 166 CALL getin('phys_out_lonmin',phys_out_lonmin) 167 CALL getin('phys_out_lonmax',phys_out_lonmax) 168 CALL getin('phys_out_latmin',phys_out_latmin) 169 CALL getin('phys_out_latmax',phys_out_latmax) 790 170 phys_out_levmin(:)=levmin(:) 791 callgetin('phys_out_levmin',levmin)171 CALL getin('phys_out_levmin',levmin) 792 172 phys_out_levmax(:)=levmax(:) 793 callgetin('phys_out_levmax',levmax)794 callgetin('phys_out_filenames',phys_out_filenames)173 CALL getin('phys_out_levmax',levmax) 174 CALL getin('phys_out_filenames',phys_out_filenames) 795 175 phys_out_filekeys(:)=clef_files(:) 796 callgetin('phys_out_filekeys',clef_files)176 CALL getin('phys_out_filekeys',clef_files) 797 177 phys_out_filestations(:)=clef_stations(:) 798 callgetin('phys_out_filestations',clef_stations)178 CALL getin('phys_out_filestations',clef_stations) 799 179 phys_out_filelevels(:)=lev_files(:) 800 callgetin('phys_out_filelevels',lev_files)801 callgetin('phys_out_filetimesteps',chtimestep)180 CALL getin('phys_out_filelevels',lev_files) 181 CALL getin('phys_out_filetimesteps',chtimestep) 802 182 phys_out_filetypes(:)=type_ecri(:) 803 callgetin('phys_out_filetypes',type_ecri)183 CALL getin('phys_out_filetypes',type_ecri) 804 184 805 185 type_ecri_files(:)=type_ecri(:) 806 186 807 write(lunout,*)'phys_out_lonmin=',phys_out_lonmin808 write(lunout,*)'phys_out_lonmax=',phys_out_lonmax809 write(lunout,*)'phys_out_latmin=',phys_out_latmin810 write(lunout,*)'phys_out_latmax=',phys_out_latmax811 write(lunout,*)'phys_out_filenames=',phys_out_filenames812 write(lunout,*)'phys_out_filetypes=',type_ecri813 write(lunout,*)'phys_out_filekeys=',clef_files814 write(lunout,*)'phys_out_filestations=',clef_stations815 write(lunout,*)'phys_out_filelevels=',lev_files187 WRITE(lunout,*)'phys_out_lonmin=',phys_out_lonmin 188 WRITE(lunout,*)'phys_out_lonmax=',phys_out_lonmax 189 WRITE(lunout,*)'phys_out_latmin=',phys_out_latmin 190 WRITE(lunout,*)'phys_out_latmax=',phys_out_latmax 191 WRITE(lunout,*)'phys_out_filenames=',phys_out_filenames 192 WRITE(lunout,*)'phys_out_filetypes=',type_ecri 193 WRITE(lunout,*)'phys_out_filekeys=',clef_files 194 WRITE(lunout,*)'phys_out_filestations=',clef_stations 195 WRITE(lunout,*)'phys_out_filelevels=',lev_files 816 196 817 197 !!!!!!!!!!!!!!!!!!!!!!! Boucle sur les fichiers !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 823 203 824 204 ! Calcul des Ahyb, Bhyb et Alt 825 dok=1,klev205 DO k=1,klev 826 206 Ahyb(k)=(ap(k)+ap(k+1))/2. 827 207 Bhyb(k)=(bp(k)+bp(k+1))/2. 828 208 Alt(k)=log(preff/presnivs(k))*8. 829 enddo209 ENDDO 830 210 ! if(prt_level.ge.1) then 831 write(lunout,*)'Ap Hybrid = ',Ahyb(1:klev)832 write(lunout,*)'Bp Hybrid = ',Bhyb(1:klev)833 write(lunout,*)'Alt approx des couches pour une haut d echelle de 8km = ',Alt(1:klev)211 WRITE(lunout,*)'Ap Hybrid = ',Ahyb(1:klev) 212 WRITE(lunout,*)'Bp Hybrid = ',Bhyb(1:klev) 213 WRITE(lunout,*)'Alt approx des couches pour une haut d echelle de 8km = ',Alt(1:klev) 834 214 ! endif 835 215 DO iff=1,nfiles 836 216 837 217 ! Calculate ecrit_files for all files 838 if( chtimestep(iff).eq.'DefFreq' ) then218 IF ( chtimestep(iff).eq.'DefFreq' ) then 839 219 ! Par defaut ecrit_files = (ecrit_mensuel ecrit_jour ecrit_hf ...)*86400. 840 220 ecrit_files(iff)=ecrit_files(iff)*86400. 841 else842 callconvers_timesteps(chtimestep(iff),dtime,ecrit_files(iff))843 endif844 write(lunout,*)'ecrit_files(',iff,')= ',ecrit_files(iff)221 ELSE 222 CALL convers_timesteps(chtimestep(iff),dtime,ecrit_files(iff)) 223 ENDIF 224 WRITE(lunout,*)'ecrit_files(',iff,')= ',ecrit_files(iff) 845 225 846 226 zoutm(iff) = ecrit_files(iff) ! Frequence ou l on ecrit en seconde … … 862 242 !!!!!!!!!!!!!!!!! Traitement dans le cas ou l'on veut stocker sur un domaine limite !! 863 243 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 864 if(phys_out_regfkey(iff)) then244 IF (phys_out_regfkey(iff)) then 865 245 866 246 imin_ins=1 … … 871 251 ! correction abderr 872 252 do i=1,iim 873 write(lunout,*)'io_lon(i)=',io_lon(i)874 if(io_lon(i).le.phys_out_lonmin(iff)) imin_ins=i875 if(io_lon(i).le.phys_out_lonmax(iff)) imax_ins=i+1253 WRITE(lunout,*)'io_lon(i)=',io_lon(i) 254 IF (io_lon(i).le.phys_out_lonmin(iff)) imin_ins=i 255 IF (io_lon(i).le.phys_out_lonmax(iff)) imax_ins=i+1 876 256 enddo 877 257 878 258 do j=1,jjmp1 879 write(lunout,*)'io_lat(j)=',io_lat(j)880 if(io_lat(j).ge.phys_out_latmin(iff)) jmax_ins=j+1881 if(io_lat(j).ge.phys_out_latmax(iff)) jmin_ins=j259 WRITE(lunout,*)'io_lat(j)=',io_lat(j) 260 IF (io_lat(j).ge.phys_out_latmin(iff)) jmax_ins=j+1 261 IF (io_lat(j).ge.phys_out_latmax(iff)) jmin_ins=j 882 262 enddo 883 263 884 write(lunout,*)'On stoke le fichier histoire numero ',iff,' sur ', &264 WRITE(lunout,*)'On stoke le fichier histoire numero ',iff,' sur ', & 885 265 imin_ins,imax_ins,jmin_ins,jmax_ins 886 write(lunout,*)'longitudes : ', &266 WRITE(lunout,*)'longitudes : ', & 887 267 io_lon(imin_ins),io_lon(imax_ins), & 888 268 'latitudes : ', & … … 895 275 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 896 276 !IM fichiers stations 897 else if(clef_stations(iff)) THEN898 899 write(lunout,*)'phys_output_mod phys_out_filenames=',phys_out_filenames(iff)900 901 callhistbeg_phy_all(rlon,rlat,pim,tabij,ipt,jpt,plon,plat,plon_bounds,plat_bounds, &277 else IF (clef_stations(iff)) THEN 278 279 WRITE(lunout,*)'phys_output_mod phys_out_filenames=',phys_out_filenames(iff) 280 281 CALL histbeg_phy_all(rlon,rlat,pim,tabij,ipt,jpt,plon,plat,plon_bounds,plat_bounds, & 902 282 phys_out_filenames(iff), & 903 283 itau_phy,zjulian,dtime,nhorim(iff),nid_files(iff)) … … 935 315 ! 1,preff,nvertp0(iff)) 936 316 !!! Champs 1D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 937 IF (.NOT.clef_stations(iff)) THEN 938 ! 939 !IM: there is no way to have one single value in a netcdf file 940 ! 941 type_ecri(1) = 'once' 942 type_ecri(2) = 'once' 943 type_ecri(3) = 'once' 944 type_ecri(4) = 'once' 945 type_ecri(5) = 'once' 946 type_ecri(6) = 'once' 947 CALL histdef2d(iff,clef_stations(iff),o_aire%flag,o_aire%name,"Grid area", "-") 948 CALL histdef2d(iff,clef_stations(iff),o_contfracATM%flag,o_contfracATM%name,"% sfce ter+lic", "-") 949 ENDIF 950 type_ecri(:) = type_ecri_files(:) 317 CALL histdef2d(iff,o_aire) 318 CALL histdef2d(iff,o_contfracATM) 951 319 952 320 !!! Champs 2D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 953 CALL histdef2d(iff,clef_stations(iff),o_phis%flag,o_phis%name,"Surface geop.height", "m2/s2" ) 954 CALL histdef2d(iff,clef_stations(iff),o_contfracOR%flag,o_contfracOR%name,"% sfce terre OR", "-" ) 955 CALL histdef2d(iff,clef_stations(iff),o_aireTER%flag,o_aireTER%name,"Grid area CONT", "-" ) 956 CALL histdef2d(iff,clef_stations(iff),o_flat%flag,o_flat%name, "Latent heat flux", "W/m2") 957 CALL histdef2d(iff,clef_stations(iff),o_slp%flag,o_slp%name, "Sea Level Pressure", "Pa" ) 958 CALL histdef2d(iff,clef_stations(iff),o_tsol%flag,o_tsol%name, "Surface Temperature", "K") 959 CALL histdef2d(iff,clef_stations(iff),o_t2m%flag,o_t2m%name, "Temperature 2m", "K" ) 960 IF (.NOT.clef_stations(iff)) THEN 961 ! 962 !IM: there is no way to have one single value in a netcdf file 963 ! 964 type_ecri(1) = 't_min(X)' 965 type_ecri(2) = 't_min(X)' 966 type_ecri(3) = 't_min(X)' 967 type_ecri(4) = 't_min(X)' 968 type_ecri(5) = 't_min(X)' 969 type_ecri(6) = 't_min(X)' 970 CALL histdef2d(iff,clef_stations(iff),o_t2m_min%flag,o_t2m_min%name, "Temp 2m min", "K" ) 971 type_ecri(1) = 't_max(X)' 972 type_ecri(2) = 't_max(X)' 973 type_ecri(3) = 't_max(X)' 974 type_ecri(4) = 't_max(X)' 975 type_ecri(5) = 't_max(X)' 976 type_ecri(6) = 't_max(X)' 977 CALL histdef2d(iff,clef_stations(iff),o_t2m_max%flag,o_t2m_max%name, "Temp 2m max", "K" ) 978 ENDIF 979 type_ecri(:) = type_ecri_files(:) 980 CALL histdef2d(iff,clef_stations(iff),o_wind10m%flag,o_wind10m%name, "10-m wind speed", "m/s") 981 CALL histdef2d(iff,clef_stations(iff),o_wind10max%flag,o_wind10max%name, "10m wind speed max", "m/s") 982 CALL histdef2d(iff,clef_stations(iff),o_sicf%flag,o_sicf%name, "Sea-ice fraction", "-" ) 983 CALL histdef2d(iff,clef_stations(iff),o_q2m%flag,o_q2m%name, "Specific humidity 2m", "kg/kg") 984 CALL histdef2d(iff,clef_stations(iff),o_ustar%flag,o_ustar%name, "Friction velocity", "m/s" ) 985 CALL histdef2d(iff,clef_stations(iff),o_u10m%flag,o_u10m%name, "Vent zonal 10m", "m/s" ) 986 CALL histdef2d(iff,clef_stations(iff),o_v10m%flag,o_v10m%name, "Vent meridien 10m", "m/s") 987 CALL histdef2d(iff,clef_stations(iff),o_psol%flag,o_psol%name, "Surface Pressure", "Pa" ) 988 CALL histdef2d(iff,clef_stations(iff),o_qsurf%flag,o_qsurf%name, "Surface Air humidity", "kg/kg") 989 990 if (.not. ok_veget) then 991 CALL histdef2d(iff,clef_stations(iff),o_qsol%flag,o_qsol%name, "Soil watter content", "mm" ) 992 endif 993 994 type_ecri(1) = 'inst(X)' 995 type_ecri(2) = 'inst(X)' 996 type_ecri(3) = 'inst(X)' 997 type_ecri(4) = 'inst(X)' 998 type_ecri(5) = 'inst(X)' 999 type_ecri(6) = 'inst(X)' 1000 CALL histdef2d(iff,clef_stations(iff),o_ndayrain%flag,o_ndayrain%name, "Number of dayrain(liq+sol)", "-") 1001 type_ecri(:) = type_ecri_files(:) 1002 CALL histdef2d(iff,clef_stations(iff),o_precip%flag,o_precip%name, "Precip Totale liq+sol", "kg/(s*m2)" ) 1003 CALL histdef2d(iff,clef_stations(iff),o_plul%flag,o_plul%name, "Large-scale Precip.", "kg/(s*m2)") 1004 CALL histdef2d(iff,clef_stations(iff),o_pluc%flag,o_pluc%name, "Convective Precip.", "kg/(s*m2)") 1005 CALL histdef2d(iff,clef_stations(iff),o_snow%flag,o_snow%name, "Snow fall", "kg/(s*m2)" ) 1006 CALL histdef2d(iff,clef_stations(iff),o_msnow%flag,o_msnow%name, "Surface snow amount", "kg/m2" ) 1007 CALL histdef2d(iff,clef_stations(iff),o_fsnow%flag,o_fsnow%name, "Surface snow area fraction", "-" ) 1008 CALL histdef2d(iff,clef_stations(iff),o_evap%flag,o_evap%name, "Evaporat", "kg/(s*m2)" ) 1009 CALL histdef2d(iff,clef_stations(iff),o_tops%flag,o_tops%name, "Solar rad. at TOA", "W/m2") 1010 CALL histdef2d(iff,clef_stations(iff),o_tops0%flag,o_tops0%name, "CS Solar rad. at TOA", "W/m2") 1011 CALL histdef2d(iff,clef_stations(iff),o_topl%flag,o_topl%name, "IR rad. at TOA", "W/m2" ) 1012 CALL histdef2d(iff,clef_stations(iff),o_topl0%flag,o_topl0%name, "IR rad. at TOA", "W/m2") 1013 CALL histdef2d(iff,clef_stations(iff),o_SWupTOA%flag,o_SWupTOA%name, "SWup at TOA", "W/m2") 1014 CALL histdef2d(iff,clef_stations(iff),o_SWupTOAclr%flag,o_SWupTOAclr%name, "SWup clear sky at TOA", "W/m2") 1015 CALL histdef2d(iff,clef_stations(iff),o_SWdnTOA%flag,o_SWdnTOA%name, "SWdn at TOA", "W/m2" ) 1016 CALL histdef2d(iff,clef_stations(iff),o_SWdnTOAclr%flag,o_SWdnTOAclr%name, "SWdn clear sky at TOA", "W/m2") 1017 CALL histdef2d(iff,clef_stations(iff),o_nettop%flag,o_nettop%name, "Net dn radiatif flux at TOA", "W/m2") 1018 CALL histdef2d(iff,clef_stations(iff),o_SWup200%flag,o_SWup200%name, "SWup at 200mb", "W/m2" ) 1019 CALL histdef2d(iff,clef_stations(iff),o_SWup200clr%flag,o_SWup200clr%name, "SWup clear sky at 200mb", "W/m2") 1020 CALL histdef2d(iff,clef_stations(iff),o_SWdn200%flag,o_SWdn200%name, "SWdn at 200mb", "W/m2" ) 1021 CALL histdef2d(iff,clef_stations(iff),o_SWdn200clr%flag,o_SWdn200clr%name, "SWdn clear sky at 200mb", "W/m2") 1022 CALL histdef2d(iff,clef_stations(iff),o_LWup200%flag,o_LWup200%name, "LWup at 200mb", "W/m2") 1023 CALL histdef2d(iff,clef_stations(iff),o_LWup200clr%flag,o_LWup200clr%name, "LWup clear sky at 200mb", "W/m2") 1024 CALL histdef2d(iff,clef_stations(iff),o_LWdn200%flag,o_LWdn200%name, "LWdn at 200mb", "W/m2") 1025 CALL histdef2d(iff,clef_stations(iff),o_LWdn200clr%flag,o_LWdn200clr%name, "LWdn clear sky at 200mb", "W/m2") 1026 CALL histdef2d(iff,clef_stations(iff),o_sols%flag,o_sols%name, "Solar rad. at surf.", "W/m2") 1027 CALL histdef2d(iff,clef_stations(iff),o_sols0%flag,o_sols0%name, "Solar rad. at surf.", "W/m2") 1028 CALL histdef2d(iff,clef_stations(iff),o_soll%flag,o_soll%name, "IR rad. at surface", "W/m2") 1029 CALL histdef2d(iff,clef_stations(iff),o_radsol%flag,o_radsol%name, "Rayonnement au sol", "W/m2") 1030 CALL histdef2d(iff,clef_stations(iff),o_soll0%flag,o_soll0%name, "IR rad. at surface", "W/m2") 1031 CALL histdef2d(iff,clef_stations(iff),o_SWupSFC%flag,o_SWupSFC%name, "SWup at surface", "W/m2") 1032 CALL histdef2d(iff,clef_stations(iff),o_SWupSFCclr%flag,o_SWupSFCclr%name, "SWup clear sky at surface", "W/m2") 1033 CALL histdef2d(iff,clef_stations(iff),o_SWdnSFC%flag,o_SWdnSFC%name, "SWdn at surface", "W/m2") 1034 CALL histdef2d(iff,clef_stations(iff),o_SWdnSFCclr%flag,o_SWdnSFCclr%name, "SWdn clear sky at surface", "W/m2") 1035 CALL histdef2d(iff,clef_stations(iff),o_LWupSFC%flag,o_LWupSFC%name, "Upwd. IR rad. at surface", "W/m2") 1036 CALL histdef2d(iff,clef_stations(iff),o_LWdnSFC%flag,o_LWdnSFC%name, "Down. IR rad. at surface", "W/m2") 1037 CALL histdef2d(iff,clef_stations(iff),o_LWupSFCclr%flag,o_LWupSFCclr%name, "CS Upwd. IR rad. at surface", "W/m2") 1038 CALL histdef2d(iff,clef_stations(iff),o_LWdnSFCclr%flag,o_LWdnSFCclr%name, "Down. CS IR rad. at surface", "W/m2") 1039 CALL histdef2d(iff,clef_stations(iff),o_bils%flag,o_bils%name, "Surf. total heat flux", "W/m2") 1040 CALL histdef2d(iff,clef_stations(iff),o_sens%flag,o_sens%name, "Sensible heat flux", "W/m2") 1041 CALL histdef2d(iff,clef_stations(iff),o_fder%flag,o_fder%name, "Heat flux derivation", "W/m2") 1042 CALL histdef2d(iff,clef_stations(iff),o_ffonte%flag,o_ffonte%name, "Thermal flux for snow melting", "W/m2") 1043 CALL histdef2d(iff,clef_stations(iff),o_fqcalving%flag,o_fqcalving%name, "Ice Calving", "kg/m2/s") 1044 CALL histdef2d(iff,clef_stations(iff),o_fqfonte%flag,o_fqfonte%name, "Land ice melt", "kg/m2/s") 1045 1046 CALL histdef2d(iff,clef_stations(iff),o_taux%flag,o_taux%name, "Zonal wind stress","Pa") 1047 CALL histdef2d(iff,clef_stations(iff),o_tauy%flag,o_tauy%name, "Meridional wind stress","Pa") 1048 1049 DO nsrf = 1, nbsrf 1050 CALL histdef2d(iff,clef_stations(iff),o_pourc_srf(nsrf)%flag,o_pourc_srf(nsrf)%name,"% "//clnsurf(nsrf),"%") 1051 CALL histdef2d(iff,clef_stations(iff),o_fract_srf(nsrf)%flag,o_fract_srf(nsrf)%name,"Fraction "//clnsurf(nsrf),"1") 1052 CALL histdef2d(iff,clef_stations(iff), & 1053 o_taux_srf(nsrf)%flag,o_taux_srf(nsrf)%name,"Zonal wind stress"//clnsurf(nsrf),"Pa") 1054 CALL histdef2d(iff,clef_stations(iff), & 1055 o_tauy_srf(nsrf)%flag,o_tauy_srf(nsrf)%name,"Meridional wind stress "//clnsurf(nsrf),"Pa") 1056 CALL histdef2d(iff,clef_stations(iff), & 1057 o_tsol_srf(nsrf)%flag,o_tsol_srf(nsrf)%name,"Temperature "//clnsurf(nsrf),"K") 1058 CALL histdef2d(iff,clef_stations(iff), & 1059 o_evappot_srf(nsrf)%flag,o_evappot_srf(nsrf)%name,"Temperature"//clnsurf(nsrf),"K") 1060 CALL histdef2d(iff,clef_stations(iff), & 1061 o_ustar_srf(nsrf)%flag,o_ustar_srf(nsrf)%name,"Friction velocity "//clnsurf(nsrf),"m/s") 1062 CALL histdef2d(iff,clef_stations(iff), & 1063 o_u10m_srf(nsrf)%flag,o_u10m_srf(nsrf)%name,"Vent Zonal 10m "//clnsurf(nsrf),"m/s") 1064 CALL histdef2d(iff,clef_stations(iff), & 1065 o_evap_srf(nsrf)%flag,o_evap_srf(nsrf)%name,"evaporation at surface "//clnsurf(nsrf),"kg/(s*m2)") 1066 CALL histdef2d(iff,clef_stations(iff), & 1067 o_v10m_srf(nsrf)%flag,o_v10m_srf(nsrf)%name,"Vent meredien 10m "//clnsurf(nsrf),"m/s") 1068 CALL histdef2d(iff,clef_stations(iff), & 1069 o_t2m_srf(nsrf)%flag,o_t2m_srf(nsrf)%name,"Temp 2m "//clnsurf(nsrf),"K") 1070 CALL histdef2d(iff,clef_stations(iff), & 1071 o_sens_srf(nsrf)%flag,o_sens_srf(nsrf)%name,"Sensible heat flux "//clnsurf(nsrf),"W/m2") 1072 CALL histdef2d(iff,clef_stations(iff), & 1073 o_lat_srf(nsrf)%flag,o_lat_srf(nsrf)%name,"Latent heat flux "//clnsurf(nsrf),"W/m2") 1074 CALL histdef2d(iff,clef_stations(iff), & 1075 o_flw_srf(nsrf)%flag,o_flw_srf(nsrf)%name,"LW "//clnsurf(nsrf),"W/m2") 1076 CALL histdef2d(iff,clef_stations(iff), & 1077 o_fsw_srf(nsrf)%flag,o_fsw_srf(nsrf)%name,"SW "//clnsurf(nsrf),"W/m2") 1078 CALL histdef2d(iff,clef_stations(iff), & 1079 o_wbils_srf(nsrf)%flag,o_wbils_srf(nsrf)%name,"Bilan sol "//clnsurf(nsrf),"W/m2" ) 1080 CALL histdef2d(iff,clef_stations(iff), & 1081 o_wbilo_srf(nsrf)%flag,o_wbilo_srf(nsrf)%name,"Bilan eau "//clnsurf(nsrf),"kg/(m2*s)") 1082 if (iflag_pbl>1 .and. lev_files(iff).gt.10 ) then 1083 CALL histdef2d(iff,clef_stations(iff), & 1084 o_tke_srf(nsrf)%flag,o_tke_srf(nsrf)%name,"Max Turb. Kinetic Energy "//clnsurf(nsrf),"-") 1085 1086 IF (.NOT.clef_stations(iff)) THEN 1087 ! 1088 !IM: there is no way to have one single value in a netcdf file 1089 ! 1090 type_ecri(1) = 't_max(X)' 1091 type_ecri(2) = 't_max(X)' 1092 type_ecri(3) = 't_max(X)' 1093 type_ecri(4) = 't_max(X)' 1094 type_ecri(5) = 't_max(X)' 1095 type_ecri(6) = 't_max(X)' 1096 CALL histdef2d(iff,clef_stations(iff), & 1097 o_tke_max_srf(nsrf)%flag,o_tke_max_srf(nsrf)%name,"Max Turb. Kinetic Energy "//clnsurf(nsrf),"-") 1098 type_ecri(:) = type_ecri_files(:) 1099 ENDIF 1100 1101 endif 1102 1103 CALL histdef2d(iff,clef_stations(iff), & 1104 o_albe_srf(nsrf)%flag,o_albe_srf(nsrf)%name,"Albedo VIS surf. "//clnsurf(nsrf),"-") 1105 CALL histdef2d(iff,clef_stations(iff), & 1106 o_rugs_srf(nsrf)%flag,o_rugs_srf(nsrf)%name,"Surface roughness "//clnsurf(nsrf),"m") 1107 CALL histdef2d(iff,clef_stations(iff), & 1108 o_ages_srf(nsrf)%flag,o_ages_srf(nsrf)%name,"Snow age", "day") 1109 END DO 1110 1111 IF (new_aod .AND. (.NOT. aerosol_couple)) THEN 1112 IF (ok_ade.OR.ok_aie) THEN 1113 1114 CALL histdef2d(iff,clef_stations(iff), & 1115 o_od550aer%flag,o_od550aer%name, "Total aerosol optical depth at 550nm", "-") 1116 CALL histdef2d(iff,clef_stations(iff), & 1117 o_od865aer%flag,o_od865aer%name, "Total aerosol optical depth at 870nm", "-") 1118 CALL histdef2d(iff,clef_stations(iff), & 1119 o_absvisaer%flag,o_absvisaer%name, "Absorption aerosol visible optical depth", "-") 1120 CALL histdef2d(iff,clef_stations(iff), & 1121 o_od550lt1aer%flag,o_od550lt1aer%name, "Fine mode optical depth", "-") 1122 1123 1124 CALL histdef2d(iff,clef_stations(iff), & 1125 o_sconcso4%flag,o_sconcso4%name,"Surface Concentration of Sulfate ","kg/m3") 1126 CALL histdef2d(iff,clef_stations(iff), & 1127 o_sconcoa%flag,o_sconcoa%name,"Surface Concentration of Organic Aerosol ","kg/m3") 1128 CALL histdef2d(iff,clef_stations(iff), & 1129 o_sconcbc%flag,o_sconcbc%name,"Surface Concentration of Black Carbon ","kg/m3") 1130 CALL histdef2d(iff,clef_stations(iff), & 1131 o_sconcss%flag,o_sconcss%name,"Surface Concentration of Sea Salt ","kg/m3") 1132 CALL histdef2d(iff,clef_stations(iff), & 1133 o_sconcdust%flag,o_sconcdust%name,"Surface Concentration of Dust ","kg/m3") 1134 CALL histdef3d(iff,clef_stations(iff), & 1135 o_concso4%flag,o_concso4%name,"Concentration of Sulfate ","kg/m3") 1136 CALL histdef3d(iff,clef_stations(iff), & 1137 o_concoa%flag,o_concoa%name,"Concentration of Organic Aerosol ","kg/m3") 1138 CALL histdef3d(iff,clef_stations(iff), & 1139 o_concbc%flag,o_concbc%name,"Concentration of Black Carbon ","kg/m3") 1140 CALL histdef3d(iff,clef_stations(iff), & 1141 o_concss%flag,o_concss%name,"Concentration of Sea Salt ","kg/m3") 1142 CALL histdef3d(iff,clef_stations(iff), & 1143 o_concdust%flag,o_concdust%name,"Concentration of Dust ","kg/m3") 1144 CALL histdef2d(iff,clef_stations(iff), & 1145 o_loadso4%flag,o_loadso4%name,"Column Load of Sulfate ","kg/m2") 1146 CALL histdef2d(iff,clef_stations(iff), & 1147 o_loadoa%flag,o_loadoa%name,"Column Load of Organic Aerosol ","kg/m2") 1148 CALL histdef2d(iff,clef_stations(iff), & 1149 o_loadbc%flag,o_loadbc%name,"Column Load of Black Carbon ","kg/m2") 1150 CALL histdef2d(iff,clef_stations(iff), & 1151 o_loadss%flag,o_loadss%name,"Column Load of Sea Salt ","kg/m2") 1152 CALL histdef2d(iff,clef_stations(iff), & 1153 o_loaddust%flag,o_loaddust%name,"Column Load of Dust ","kg/m2") 1154 1155 DO naero = 1, naero_spc 1156 CALL histdef2d(iff,clef_stations(iff), & 1157 o_tausumaero(naero)%flag,o_tausumaero(naero)%name,"Aerosol Optical depth at 550 nm "//name_aero(naero),"1") 1158 END DO 1159 ENDIF 1160 ENDIF 1161 1162 IF (ok_ade) THEN 1163 CALL histdef2d(iff,clef_stations(iff), & 1164 o_topswad%flag,o_topswad%name, "ADE at TOA", "W/m2") 1165 CALL histdef2d(iff,clef_stations(iff), & 1166 o_topswad0%flag,o_topswad0%name, "ADE clear-sky at TOA", "W/m2") 1167 CALL histdef2d(iff,clef_stations(iff), & 1168 o_solswad%flag,o_solswad%name, "ADE at SRF", "W/m2") 1169 CALL histdef2d(iff,clef_stations(iff), & 1170 o_solswad0%flag,o_solswad0%name, "ADE clear-sky at SRF", "W/m2") 1171 1172 CALL histdef2d(iff,clef_stations(iff), & 1173 o_swtoaas_nat%flag,o_swtoaas_nat%name, "Natural aerosol radiative forcing all-sky at TOA", "W/m2") 1174 CALL histdef2d(iff,clef_stations(iff), & 1175 o_swsrfas_nat%flag,o_swsrfas_nat%name, "Natural aerosol radiative forcing all-sky at SRF", "W/m2") 1176 CALL histdef2d(iff,clef_stations(iff), & 1177 o_swtoacs_nat%flag,o_swtoacs_nat%name, "Natural aerosol radiative forcing clear-sky at TOA", "W/m2") 1178 CALL histdef2d(iff,clef_stations(iff), & 1179 o_swsrfcs_nat%flag,o_swsrfcs_nat%name, "Natural aerosol radiative forcing clear-sky at SRF", "W/m2") 1180 1181 CALL histdef2d(iff,clef_stations(iff), & 1182 o_swtoaas_ant%flag,o_swtoaas_ant%name, "Anthropogenic aerosol radiative forcing all-sky at TOA", "W/m2") 1183 CALL histdef2d(iff,clef_stations(iff), & 1184 o_swsrfas_ant%flag,o_swsrfas_ant%name, "Anthropogenic aerosol radiative forcing all-sky at SRF", "W/m2") 1185 CALL histdef2d(iff,clef_stations(iff), & 1186 o_swtoacs_ant%flag,o_swtoacs_ant%name, "Anthropogenic aerosol radiative forcing clear-sky at TOA", "W/m2") 1187 CALL histdef2d(iff,clef_stations(iff), & 1188 o_swsrfcs_ant%flag,o_swsrfcs_ant%name, "Anthropogenic aerosol radiative forcing clear-sky at SRF", "W/m2") 1189 1190 IF (.NOT. aerosol_couple) THEN 1191 CALL histdef2d(iff,clef_stations(iff), & 1192 o_swtoacf_nat%flag,o_swtoacf_nat%name, "Natural aerosol impact on cloud radiative forcing at TOA", "W/m2") 1193 CALL histdef2d(iff,clef_stations(iff), & 1194 o_swsrfcf_nat%flag,o_swsrfcf_nat%name, "Natural aerosol impact on cloud radiative forcing at SRF", "W/m2") 1195 CALL histdef2d(iff, clef_stations(iff), o_swtoacf_ant%flag, & 1196 o_swtoacf_ant%name, & 1197 "Anthropogenic aerosol impact on cloud radiative forcing at TOA", & 1198 "W/m2") 1199 CALL histdef2d(iff, clef_stations(iff), o_swsrfcf_ant%flag, & 1200 o_swsrfcf_ant%name, & 1201 "Anthropogenic aerosol impact on cloud radiative forcing at SRF", & 1202 "W/m2") 1203 CALL histdef2d(iff,clef_stations(iff), & 1204 o_swtoacf_zero%flag,o_swtoacf_zero%name, "Cloud radiative forcing (allsky-clearsky fluxes) at TOA", "W/m2") 1205 CALL histdef2d(iff,clef_stations(iff), & 1206 o_swsrfcf_zero%flag,o_swsrfcf_zero%name, "Cloud radiative forcing (allsky-clearsky fluxes) at SRF", "W/m2") 1207 ENDIF 1208 ENDIF 1209 1210 IF (ok_aie) THEN 1211 CALL histdef2d(iff,clef_stations(iff), & 1212 o_topswai%flag,o_topswai%name, "AIE at TOA", "W/m2") 1213 CALL histdef2d(iff,clef_stations(iff), & 1214 o_solswai%flag,o_solswai%name, "AIE at SFR", "W/m2") 1215 !Cloud droplet number concentration 1216 CALL histdef3d(iff,clef_stations(iff), & 1217 o_scdnc%flag,o_scdnc%name, "Cloud droplet number concentration","m-3") 1218 CALL histdef2d(iff,clef_stations(iff), & 1219 o_cldncl%flag,o_cldncl%name, "CDNC at top of liquid water cloud", "m-3") 1220 CALL histdef3d(iff,clef_stations(iff), & 1221 o_reffclws%flag,o_reffclws%name, "Stratiform Cloud Droplet Effective Radius (aerosol diags.)","m") 1222 CALL histdef3d(iff,clef_stations(iff), & 1223 o_reffclwc%flag,o_reffclwc%name, "Convective Cloud Droplet Effective Radius (aerosol diags.)","m") 1224 CALL histdef2d(iff,clef_stations(iff), & 1225 o_cldnvi%flag,o_cldnvi%name, "Column Integrated Cloud Droplet Number", "m-2") 1226 CALL histdef3d(iff,clef_stations(iff), & 1227 o_lcc3d%flag,o_lcc3d%name, "Cloud liquid fraction","1") 1228 CALL histdef3d(iff,clef_stations(iff), & 1229 o_lcc3dcon%flag,o_lcc3dcon%name, "Convective cloud liquid fraction","1") 1230 CALL histdef3d(iff,clef_stations(iff), & 1231 o_lcc3dstra%flag,o_lcc3dstra%name, "Stratiform cloud liquid fraction","1") 1232 CALL histdef2d(iff,clef_stations(iff), & 1233 o_lcc%flag,o_lcc%name, "Cloud liquid fraction at top of cloud","1") 1234 CALL histdef2d(iff,clef_stations(iff), & 1235 o_reffclwtop%flag,o_reffclwtop%name, "Droplet effective radius at top of liquid water cloud", "m") 1236 ENDIF 1237 1238 1239 CALL histdef2d(iff,clef_stations(iff), & 1240 o_alb1%flag,o_alb1%name, "Surface VIS albedo", "-") 1241 CALL histdef2d(iff,clef_stations(iff), & 1242 o_alb2%flag,o_alb2%name, "Surface Near IR albedo", "-") 1243 CALL histdef2d(iff,clef_stations(iff), & 1244 o_cdrm%flag,o_cdrm%name, "Momentum drag coef.", "-") 1245 CALL histdef2d(iff,clef_stations(iff), & 1246 o_cdrh%flag,o_cdrh%name, "Heat drag coef.", "-" ) 1247 CALL histdef2d(iff,clef_stations(iff), & 1248 o_cldl%flag,o_cldl%name, "Low-level cloudiness", "-") 1249 CALL histdef2d(iff,clef_stations(iff), & 1250 o_cldm%flag,o_cldm%name, "Mid-level cloudiness", "-") 1251 CALL histdef2d(iff,clef_stations(iff), & 1252 o_cldh%flag,o_cldh%name, "High-level cloudiness", "-") 1253 CALL histdef2d(iff,clef_stations(iff), & 1254 o_cldt%flag,o_cldt%name, "Total cloudiness", "-") 1255 CALL histdef2d(iff,clef_stations(iff), & 1256 o_cldq%flag,o_cldq%name, "Cloud liquid water path", "kg/m2") 1257 CALL histdef2d(iff,clef_stations(iff), & 1258 o_lwp%flag,o_lwp%name, "Cloud water path", "kg/m2") 1259 CALL histdef2d(iff,clef_stations(iff), & 1260 o_iwp%flag,o_iwp%name, "Cloud ice water path", "kg/m2" ) 1261 CALL histdef2d(iff,clef_stations(iff), & 1262 o_ue%flag,o_ue%name, "Zonal energy transport", "-") 1263 CALL histdef2d(iff,clef_stations(iff), & 1264 o_ve%flag,o_ve%name, "Merid energy transport", "-") 1265 CALL histdef2d(iff,clef_stations(iff), & 1266 o_uq%flag,o_uq%name, "Zonal humidity transport", "-") 1267 CALL histdef2d(iff,clef_stations(iff), & 1268 o_vq%flag,o_vq%name, "Merid humidity transport", "-") 1269 1270 IF(iflag_con.GE.3) THEN ! sb 1271 CALL histdef2d(iff,clef_stations(iff), & 1272 o_cape%flag,o_cape%name, "Conv avlbl pot ener", "J/kg") 1273 CALL histdef2d(iff,clef_stations(iff), & 1274 o_pbase%flag,o_pbase%name, "Cld base pressure", "Pa") 1275 CALL histdef2d(iff,clef_stations(iff), & 1276 o_ptop%flag,o_ptop%name, "Cld top pressure", "Pa") 1277 CALL histdef2d(iff,clef_stations(iff), & 1278 o_fbase%flag,o_fbase%name, "Cld base mass flux", "kg/m2/s") 1279 if (iflag_con /= 30) then 1280 CALL histdef2d(iff,clef_stations(iff), & 1281 o_plcl%flag,o_plcl%name, "Lifting Condensation Level", "hPa") 1282 CALL histdef2d(iff,clef_stations(iff), & 1283 o_plfc%flag,o_plfc%name, "Level of Free Convection", "hPa") 1284 CALL histdef2d(iff,clef_stations(iff), & 1285 o_wbeff%flag,o_wbeff%name, "Conv. updraft velocity at LFC (<100)", "m/s") 1286 end if 1287 IF (.NOT.clef_stations(iff)) THEN 1288 ! 1289 !IM: there is no way to have one single value in a netcdf file 1290 ! 1291 type_ecri(1) = 't_max(X)' 1292 type_ecri(2) = 't_max(X)' 1293 type_ecri(3) = 't_max(X)' 1294 type_ecri(4) = 't_max(X)' 1295 type_ecri(5) = 't_max(X)' 1296 type_ecri(6) = 't_max(X)' 1297 CALL histdef2d(iff,clef_stations(iff), & 1298 o_cape_max%flag,o_cape_max%name, "CAPE max.", "J/kg") 1299 ENDIF 1300 type_ecri(:) = type_ecri_files(:) 1301 CALL histdef3d(iff,clef_stations(iff), & 1302 o_upwd%flag,o_upwd%name, "saturated updraft", "kg/m2/s") 1303 CALL histdef3d(iff,clef_stations(iff), & 1304 o_Ma%flag,o_Ma%name, "undilute adiab updraft", "kg/m2/s") 1305 CALL histdef3d(iff,clef_stations(iff), & 1306 o_dnwd%flag,o_dnwd%name, "saturated downdraft", "kg/m2/s") 1307 CALL histdef3d(iff,clef_stations(iff), & 1308 o_dnwd0%flag,o_dnwd0%name, "unsat. downdraft", "kg/m2/s") 1309 CALL histdef3d(iff,clef_stations(iff), & 1310 o_mc%flag,o_mc%name, "Convective mass flux", "kg/m2/s") 1311 type_ecri(1) = 'inst(X)' 1312 type_ecri(2) = 'inst(X)' 1313 type_ecri(3) = 'inst(X)' 1314 type_ecri(4) = 'inst(X)' 1315 type_ecri(5) = 'inst(X)' 1316 type_ecri(6) = 'inst(X)' 1317 CALL histdef2d(iff,clef_stations(iff), & 1318 o_ftime_con%flag,o_ftime_con%name, "Fraction of time convection Occurs", " ") 1319 type_ecri(:) = type_ecri_files(:) 1320 ENDIF !iflag_con .GE. 3 1321 1322 CALL histdef2d(iff,clef_stations(iff), & 1323 o_prw%flag,o_prw%name, "Precipitable water", "kg/m2") 1324 CALL histdef2d(iff,clef_stations(iff), & 1325 o_s_pblh%flag,o_s_pblh%name, "Boundary Layer Height", "m") 1326 CALL histdef2d(iff,clef_stations(iff), & 1327 o_s_pblt%flag,o_s_pblt%name, "t at Boundary Layer Height", "K") 1328 CALL histdef2d(iff,clef_stations(iff), & 1329 o_s_lcl%flag,o_s_lcl%name, "Condensation level", "m") 1330 CALL histdef2d(iff,clef_stations(iff), & 1331 o_s_therm%flag,o_s_therm%name, "Exces du thermique", "K") 321 CALL histdef2d(iff,o_phis) 322 CALL histdef2d(iff,o_contfracOR) 323 CALL histdef2d(iff,o_aireTER) 324 CALL histdef2d(iff,o_flat) 325 CALL histdef2d(iff,o_slp) 326 CALL histdef2d(iff,o_tsol) 327 CALL histdef2d(iff,o_t2m) 328 CALL histdef2d(iff,o_t2m_min) 329 CALL histdef2d(iff,o_t2m_max) 330 CALL histdef2d(iff,o_wind10m) 331 CALL histdef2d(iff,o_wind10max) 332 CALL histdef2d(iff,o_sicf) 333 CALL histdef2d(iff,o_q2m) 334 CALL histdef2d(iff,o_ustar) 335 CALL histdef2d(iff,o_u10m) 336 CALL histdef2d(iff,o_v10m) 337 CALL histdef2d(iff,o_psol) 338 CALL histdef2d(iff,o_qsurf) 339 340 IF (.NOT. ok_veget) THEN 341 CALL histdef2d(iff,o_qsol) 342 ENDIF 343 CALL histdef2d(iff,o_ndayrain) 344 CALL histdef2d(iff,o_precip) 345 CALL histdef2d(iff,o_plul) 346 CALL histdef2d(iff,o_pluc) 347 CALL histdef2d(iff,o_snow) 348 CALL histdef2d(iff,o_msnow) 349 CALL histdef2d(iff,o_fsnow) 350 CALL histdef2d(iff,o_evap) 351 CALL histdef2d(iff,o_tops) 352 CALL histdef2d(iff,o_tops0) 353 CALL histdef2d(iff,o_topl) 354 CALL histdef2d(iff,o_topl0) 355 CALL histdef2d(iff,o_SWupTOA) 356 CALL histdef2d(iff,o_SWupTOAclr) 357 CALL histdef2d(iff,o_SWdnTOA) 358 CALL histdef2d(iff,o_SWdnTOAclr) 359 CALL histdef2d(iff,o_nettop) 360 CALL histdef2d(iff,o_SWup200) 361 CALL histdef2d(iff,o_SWup200clr) 362 CALL histdef2d(iff,o_SWdn200) 363 CALL histdef2d(iff,o_SWdn200clr) 364 CALL histdef2d(iff,o_LWup200) 365 CALL histdef2d(iff,o_LWup200clr) 366 CALL histdef2d(iff,o_LWdn200) 367 CALL histdef2d(iff,o_LWdn200clr) 368 CALL histdef2d(iff,o_sols) 369 CALL histdef2d(iff,o_sols0) 370 CALL histdef2d(iff,o_soll) 371 CALL histdef2d(iff,o_radsol) 372 CALL histdef2d(iff,o_soll0) 373 CALL histdef2d(iff,o_SWupSFC) 374 CALL histdef2d(iff,o_SWupSFCclr) 375 CALL histdef2d(iff,o_SWdnSFC) 376 CALL histdef2d(iff,o_SWdnSFCclr) 377 CALL histdef2d(iff,o_LWupSFC) 378 CALL histdef2d(iff,o_LWdnSFC) 379 CALL histdef2d(iff,o_LWupSFCclr) 380 CALL histdef2d(iff,o_LWdnSFCclr) 381 CALL histdef2d(iff,o_bils) 382 CALL histdef2d(iff,o_bils_ec) 383 CALL histdef2d(iff,o_bils_tke) 384 CALL histdef2d(iff,o_bils_diss) 385 CALL histdef2d(iff,o_bils_kinetic) 386 CALL histdef2d(iff,o_bils_enthalp) 387 CALL histdef2d(iff,o_bils_latent) 388 CALL histdef2d(iff,o_sens) 389 CALL histdef2d(iff,o_fder) 390 CALL histdef2d(iff,o_ffonte) 391 CALL histdef2d(iff,o_fqcalving) 392 CALL histdef2d(iff,o_fqfonte) 393 CALL histdef2d(iff,o_taux) 394 CALL histdef2d(iff,o_tauy) 395 396 DO nsrf = 1, nbsrf 397 CALL histdef2d(iff,o_pourc_srf(nsrf)) 398 CALL histdef2d(iff,o_fract_srf(nsrf)) 399 CALL histdef2d(iff, o_taux_srf(nsrf)) 400 CALL histdef2d(iff, o_tauy_srf(nsrf)) 401 CALL histdef2d(iff, o_tsol_srf(nsrf)) 402 CALL histdef2d(iff, o_evappot_srf(nsrf)) 403 CALL histdef2d(iff, o_ustar_srf(nsrf)) 404 CALL histdef2d(iff, o_u10m_srf(nsrf)) 405 CALL histdef2d(iff, o_evap_srf(nsrf)) 406 CALL histdef2d(iff, o_v10m_srf(nsrf)) 407 CALL histdef2d(iff, o_t2m_srf(nsrf)) 408 CALL histdef2d(iff, o_sens_srf(nsrf)) 409 CALL histdef2d(iff, o_lat_srf(nsrf)) 410 CALL histdef2d(iff, o_flw_srf(nsrf)) 411 CALL histdef2d(iff, o_fsw_srf(nsrf)) 412 CALL histdef2d(iff, o_wbils_srf(nsrf)) 413 CALL histdef2d(iff, o_wbilo_srf(nsrf)) 414 IF (iflag_pbl>1 ) then 415 CALL histdef2d(iff, o_tke_srf(nsrf)) 416 CALL histdef2d(iff, o_tke_max_srf(nsrf)) 417 ENDIF 418 419 CALL histdef2d(iff, o_albe_srf(nsrf)) 420 CALL histdef2d(iff, o_rugs_srf(nsrf)) 421 CALL histdef2d(iff, o_ages_srf(nsrf)) 422 END DO 423 424 IF (new_aod .AND. (.NOT. aerosol_couple)) THEN 425 IF (ok_ade.OR.ok_aie) THEN 426 CALL histdef2d(iff,o_od550aer) 427 CALL histdef2d(iff,o_od865aer) 428 CALL histdef2d(iff,o_absvisaer) 429 CALL histdef2d(iff,o_od550lt1aer) 430 CALL histdef2d(iff,o_sconcso4) 431 CALL histdef2d(iff,o_sconcoa) 432 CALL histdef2d(iff,o_sconcbc) 433 CALL histdef2d(iff,o_sconcss) 434 CALL histdef2d(iff,o_sconcdust) 435 CALL histdef3d(iff,o_concso4) 436 CALL histdef3d(iff,o_concoa) 437 CALL histdef3d(iff,o_concbc) 438 CALL histdef3d(iff,o_concss) 439 CALL histdef3d(iff,o_concdust) 440 CALL histdef2d(iff,o_loadso4) 441 CALL histdef2d(iff,o_loadoa) 442 CALL histdef2d(iff,o_loadbc) 443 CALL histdef2d(iff,o_loadss) 444 CALL histdef2d(iff,o_loaddust) 445 !--STRAT AER 446 ENDIF 447 IF (ok_ade.OR.ok_aie.OR.flag_aerosol_strat) THEN 448 DO naero = 1, naero_spc 449 CALL histdef2d(iff, o_tausumaero(naero)) 450 END DO 451 ENDIF 452 ENDIF 453 454 IF (ok_ade) THEN 455 CALL histdef2d(iff,o_topswad) 456 CALL histdef2d(iff,o_topswad0) 457 CALL histdef2d(iff,o_solswad) 458 CALL histdef2d(iff,o_solswad0) 459 CALL histdef2d(iff,o_swtoaas_nat) 460 CALL histdef2d(iff,o_swsrfas_nat) 461 CALL histdef2d(iff,o_swtoacs_nat) 462 CALL histdef2d(iff,o_swsrfcs_nat) 463 CALL histdef2d(iff,o_swtoaas_ant) 464 CALL histdef2d(iff,o_swsrfas_ant) 465 CALL histdef2d(iff,o_swtoacs_ant) 466 CALL histdef2d(iff,o_swsrfcs_ant) 467 468 IF (.NOT. aerosol_couple) THEN 469 CALL histdef2d(iff,o_swtoacf_nat) 470 CALL histdef2d(iff,o_swsrfcf_nat) 471 CALL histdef2d(iff,o_swtoacf_ant) 472 CALL histdef2d(iff,o_swsrfcf_ant) 473 CALL histdef2d(iff,o_swtoacf_zero) 474 CALL histdef2d(iff,o_swsrfcf_zero) 475 ENDIF 476 ENDIF 477 478 IF (ok_aie) THEN 479 CALL histdef2d(iff,o_topswai) 480 CALL histdef2d(iff,o_solswai) 481 !Cloud droplet number concentration 482 CALL histdef3d(iff,o_scdnc) 483 CALL histdef2d(iff,o_cldncl) 484 CALL histdef3d(iff,o_reffclws) 485 CALL histdef3d(iff,o_reffclwc) 486 CALL histdef2d(iff,o_cldnvi) 487 CALL histdef3d(iff,o_lcc3d) 488 CALL histdef3d(iff,o_lcc3dcon) 489 CALL histdef3d(iff,o_lcc3dstra) 490 CALL histdef2d(iff,o_lcc) 491 CALL histdef2d(iff,o_reffclwtop) 492 ENDIF 493 CALL histdef2d(iff,o_alb1) 494 CALL histdef2d(iff,o_alb2) 495 CALL histdef2d(iff,o_cdrm) 496 CALL histdef2d(iff,o_cdrh) 497 CALL histdef2d(iff,o_cldl) 498 CALL histdef2d(iff,o_cldm) 499 CALL histdef2d(iff,o_cldh) 500 CALL histdef2d(iff,o_cldt) 501 CALL histdef2d(iff,o_cldq) 502 CALL histdef2d(iff,o_lwp) 503 CALL histdef2d(iff,o_iwp) 504 CALL histdef2d(iff,o_ue) 505 CALL histdef2d(iff,o_ve) 506 CALL histdef2d(iff,o_uq) 507 CALL histdef2d(iff,o_vq) 508 509 IF(iflag_con.GE.3) THEN ! sb 510 CALL histdef2d(iff,o_cape) 511 CALL histdef2d(iff,o_pbase) 512 CALL histdef2d(iff,o_ptop) 513 CALL histdef2d(iff,o_fbase) 514 IF (iflag_con /= 30) THEN 515 CALL histdef2d(iff,o_plcl) 516 CALL histdef2d(iff,o_plfc) 517 CALL histdef2d(iff,o_wbeff) 518 ENDIF 519 CALL histdef2d(iff,o_cape_max) 520 CALL histdef3d(iff,o_upwd) 521 CALL histdef3d(iff,o_Ma) 522 CALL histdef3d(iff,o_dnwd) 523 CALL histdef3d(iff,o_dnwd0) 524 CALL histdef3d(iff,o_mc) 525 CALL histdef2d(iff,o_ftime_con) 526 ENDIF !iflag_con .GE. 3 527 CALL histdef2d(iff,o_prw) 528 CALL histdef2d(iff,o_s_pblh) 529 CALL histdef2d(iff,o_s_pblt) 530 CALL histdef2d(iff,o_s_lcl) 531 CALL histdef2d(iff,o_s_therm) 1332 532 !IM : Les champs suivants (s_oliqCL, s_cteiCL, s_trmb1, s_trmb2, s_trmb3) ne sont pas definis dans HBTM.F 1333 !CALL histdef2d(iff, clef_stations(iff),&533 !CALL histdef2d(iff, & 1334 534 !o_s_capCL%flag,o_s_capCL%name, "Conv avlbl pot enerfor ABL", "J/m2" ) 1335 !CALL histdef2d(iff, clef_stations(iff),&535 !CALL histdef2d(iff, & 1336 536 !o_s_oliqCL%flag,o_s_oliqCL%name, "Liq Water in BL", "kg/m2") 1337 !CALL histdef2d(iff, clef_stations(iff),&537 !CALL histdef2d(iff, & 1338 538 !o_s_cteiCL%flag,o_s_cteiCL%name, "Instability criteria(ABL)", "K") 1339 !CALL histdef2d(iff, clef_stations(iff),&539 !CALL histdef2d(iff, & 1340 540 !o_s_trmb1%flag,o_s_trmb1%name, "deep_cape(HBTM2)", "J/m2") 1341 !CALL histdef2d(iff, clef_stations(iff),&541 !CALL histdef2d(iff, & 1342 542 !o_s_trmb2%flag,o_s_trmb2%name, "inhibition (HBTM2)", "J/m2") 1343 !CALL histdef2d(iff, clef_stations(iff),&543 !CALL histdef2d(iff, & 1344 544 !o_s_trmb3%flag,o_s_trmb3%name, "Point Omega (HBTM2)", "m") 1345 545 1346 546 ! Champs interpolles sur des niveaux de pression 1347 547 1348 type_ecri(1) = 'inst(X)'1349 type_ecri(2) = 'inst(X)'1350 type_ecri(3) = 'inst(X)'1351 type_ecri(4) = 'inst(X)'1352 type_ecri(5) = 'inst(X)'1353 type_ecri(6) = 'inst(X)'1354 1355 548 ! Attention a reverifier 1356 549 1357 1358 1359 1360 550 ilev=0 551 DO k=1, nlevSTD 552 bb2=clevSTD(k) 553 IF(bb2.EQ."850".OR.bb2.EQ."700".OR.bb2.EQ."500".OR.bb2.EQ."200" & 1361 554 .OR.bb2.EQ."100".OR.bb2.EQ."50".OR.bb2.EQ."10")THEN 1362 ilev=ilev+1 1363 ! print*,'ilev k bb2 flag name ',ilev,k, bb2,o_uSTDlevs(ilev)%flag,o_uSTDlevs(ilev)%name 1364 CALL histdef2d(iff,clef_stations(iff), & 1365 o_uSTDlevs(ilev)%flag,o_uSTDlevs(ilev)%name,"Zonal wind "//bb2//"hPa", "m/s") 1366 CALL histdef2d(iff,clef_stations(iff), & 1367 o_vSTDlevs(ilev)%flag,o_vSTDlevs(ilev)%name,"Meridional wind "//bb2//"hPa", "m/s") 1368 CALL histdef2d(iff,clef_stations(iff), & 1369 o_wSTDlevs(ilev)%flag,o_wSTDlevs(ilev)%name,"Vertical wind "//bb2//"hPa", "Pa/s") 1370 CALL histdef2d(iff,clef_stations(iff), & 1371 o_zSTDlevs(ilev)%flag,o_zSTDlevs(ilev)%name,"Geopotential height "//bb2//"hPa", "m") 1372 CALL histdef2d(iff,clef_stations(iff), & 1373 o_qSTDlevs(ilev)%flag,o_qSTDlevs(ilev)%name,"Specific humidity "//bb2//"hPa", "kg/kg" ) 1374 CALL histdef2d(iff,clef_stations(iff), & 1375 o_tSTDlevs(ilev)%flag,o_tSTDlevs(ilev)%name,"Temperature "//bb2//"hPa", "K") 1376 ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR."500".OR.bb2.EQ."200".OR.bb2.EQ."50".OR.bb2.EQ."10") 1377 ENDDO 1378 type_ecri(:) = type_ecri_files(:) 1379 1380 CALL histdef2d(iff,clef_stations(iff), & 1381 o_t_oce_sic%flag,o_t_oce_sic%name, "Temp mixte oce-sic", "K") 1382 1383 IF (type_ocean=='slab') & 1384 CALL histdef2d(iff,clef_stations(iff), & 1385 o_slab_bils%flag, o_slab_bils%name,"Bilan au sol sur ocean slab", "W/m2") 1386 1387 ! Couplage conv-CL 1388 IF (iflag_con.GE.3) THEN 1389 IF (iflag_coupl>=1) THEN 1390 CALL histdef2d(iff,clef_stations(iff), & 1391 o_ale_bl%flag,o_ale_bl%name, "ALE BL", "m2/s2") 1392 CALL histdef2d(iff,clef_stations(iff), & 1393 o_alp_bl%flag,o_alp_bl%name, "ALP BL", "m2/s2") 1394 ENDIF 1395 ENDIF !(iflag_con.GE.3) 1396 1397 CALL histdef2d(iff,clef_stations(iff), & 1398 o_weakinv%flag,o_weakinv%name, "Weak inversion", "-") 1399 CALL histdef2d(iff,clef_stations(iff), & 1400 o_dthmin%flag,o_dthmin%name, "dTheta mini", "K/m") 1401 CALL histdef2d(iff,clef_stations(iff), & 1402 o_rh2m%flag,o_rh2m%name, "Relative humidity at 2m", "%" ) 1403 1404 IF (.NOT.clef_stations(iff)) THEN 1405 ! 1406 !IM: there is no way to have one single value in a netcdf file 1407 ! 1408 type_ecri(1) = 't_min(X)' 1409 type_ecri(2) = 't_min(X)' 1410 type_ecri(3) = 't_min(X)' 1411 type_ecri(4) = 't_min(X)' 1412 type_ecri(5) = 't_min(X)' 1413 type_ecri(6) = 't_min(X)' 1414 CALL histdef2d(iff,clef_stations(iff),o_rh2m_min%flag,o_rh2m_min%name, "Min Relative humidity at 2m", "%" ) 1415 type_ecri(1) = 't_max(X)' 1416 type_ecri(2) = 't_max(X)' 1417 type_ecri(3) = 't_max(X)' 1418 type_ecri(4) = 't_max(X)' 1419 type_ecri(5) = 't_max(X)' 1420 type_ecri(6) = 't_max(X)' 1421 CALL histdef2d(iff,clef_stations(iff),o_rh2m_max%flag,o_rh2m_max%name, "Max Relative humidity at 2m", "%" ) 1422 ENDIF 1423 1424 type_ecri(:) = type_ecri_files(:) 1425 CALL histdef2d(iff,clef_stations(iff),o_qsat2m%flag,o_qsat2m%name, "Saturant humidity at 2m", "%") 1426 CALL histdef2d(iff,clef_stations(iff),o_tpot%flag,o_tpot%name, "Surface air potential temperature", "K") 1427 CALL histdef2d(iff,clef_stations(iff), & 1428 o_tpote%flag,o_tpote%name, "Surface air equivalent potential temperature", "K") 1429 CALL histdef2d(iff,clef_stations(iff),o_SWnetOR%flag,o_SWnetOR%name, "Sfce net SW radiation OR", "W/m2") 1430 CALL histdef2d(iff,clef_stations(iff),o_SWdownOR%flag,o_SWdownOR%name, "Sfce incident SW radiation OR", "W/m2") 1431 CALL histdef2d(iff,clef_stations(iff),o_LWdownOR%flag,o_LWdownOR%name, "Sfce incident LW radiation OR", "W/m2") 1432 CALL histdef2d(iff,clef_stations(iff),o_snowl%flag,o_snowl%name, "Solid Large-scale Precip.", "kg/(m2*s)") 1433 1434 CALL histdef2d(iff,clef_stations(iff),o_solldown%flag,o_solldown%name, "Down. IR rad. at surface", "W/m2") 1435 CALL histdef2d(iff,clef_stations(iff),o_dtsvdfo%flag,o_dtsvdfo%name, "Boundary-layer dTs(o)", "K/s") 1436 CALL histdef2d(iff,clef_stations(iff),o_dtsvdft%flag,o_dtsvdft%name, "Boundary-layer dTs(t)", "K/s") 1437 CALL histdef2d(iff,clef_stations(iff),o_dtsvdfg%flag,o_dtsvdfg%name, "Boundary-layer dTs(g)", "K/s") 1438 CALL histdef2d(iff,clef_stations(iff),o_dtsvdfi%flag,o_dtsvdfi%name, "Boundary-layer dTs(g)", "K/s") 1439 CALL histdef2d(iff,clef_stations(iff),o_rugs%flag,o_rugs%name, "rugosity", "-" ) 555 ilev=ilev+1 556 ! print*,'ilev k bb2 flag name ',ilev,k, bb2,o_uSTDlevs(ilev)%flag,o_uSTDlevs(ilev)%name 557 CALL histdef2d(iff,o_uSTDlevs(ilev)) 558 CALL histdef2d(iff,o_vSTDlevs(ilev)) 559 CALL histdef2d(iff,o_wSTDlevs(ilev)) 560 CALL histdef2d(iff,o_zSTDlevs(ilev)) 561 CALL histdef2d(iff,o_qSTDlevs(ilev)) 562 CALL histdef2d(iff,o_tSTDlevs(ilev)) 563 ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR."500".OR.bb2.EQ."200".OR.bb2.EQ."50".OR.bb2.EQ."10") 564 ENDDO 565 566 CALL histdef2d(iff,o_t_oce_sic) 567 568 IF (type_ocean=='slab') THEN 569 CALL histdef2d(iff,o_slab_bils) 570 ENDIF 571 572 ! Couplage conv-CL 573 IF (iflag_con.GE.3) THEN 574 IF (iflag_coupl>=1) THEN 575 CALL histdef2d(iff,o_ale_bl) 576 CALL histdef2d(iff,o_alp_bl) 577 ENDIF 578 ENDIF !(iflag_con.GE.3) 579 580 CALL histdef2d(iff,o_weakinv) 581 CALL histdef2d(iff,o_dthmin) 582 583 CALL histdef2d(iff,o_rh2m) 584 CALL histdef2d(iff,o_rh2m_min) 585 CALL histdef2d(iff,o_rh2m_max) 586 587 CALL histdef2d(iff,o_qsat2m) 588 CALL histdef2d(iff,o_tpot) 589 CALL histdef2d(iff,o_tpote) 590 CALL histdef2d(iff,o_SWnetOR) 591 CALL histdef2d(iff,o_SWdownOR) 592 CALL histdef2d(iff,o_LWdownOR) 593 CALL histdef2d(iff,o_snowl) 594 CALL histdef2d(iff,o_solldown) 595 CALL histdef2d(iff,o_dtsvdfo) 596 CALL histdef2d(iff,o_dtsvdft) 597 CALL histdef2d(iff,o_dtsvdfg) 598 CALL histdef2d(iff,o_dtsvdfi) 599 CALL histdef2d(iff,o_rugs) 1440 600 1441 601 ! Champs 3D: 1442 CALL histdef3d(iff,clef_stations(iff),o_ec550aer%flag,o_ec550aer%name, "Extinction at 550nm", "m^-1") 1443 CALL histdef3d(iff,clef_stations(iff),o_lwcon%flag,o_lwcon%name, "Cloud liquid water content", "kg/kg") 1444 CALL histdef3d(iff,clef_stations(iff),o_iwcon%flag,o_iwcon%name, "Cloud ice water content", "kg/kg") 1445 CALL histdef3d(iff,clef_stations(iff),o_temp%flag,o_temp%name, "Air temperature", "K" ) 1446 CALL histdef3d(iff,clef_stations(iff),o_theta%flag,o_theta%name, "Potential air temperature", "K" ) 1447 CALL histdef3d(iff,clef_stations(iff),o_ovap%flag,o_ovap%name, "Specific humidity", "kg/kg" ) 1448 CALL histdef3d(iff,clef_stations(iff),o_oliq%flag,o_oliq%name, "Condensed water", "kg/kg" ) 1449 CALL histdef3d(iff,clef_stations(iff), & 1450 o_ovapinit%flag,o_ovapinit%name, "Specific humidity (begin of timestep)", "kg/kg" ) 1451 CALL histdef3d(iff,clef_stations(iff), & 1452 o_geop%flag,o_geop%name, "Geopotential height", "m2/s2") 1453 CALL histdef3d(iff,clef_stations(iff), & 1454 o_vitu%flag,o_vitu%name, "Zonal wind", "m/s" ) 1455 CALL histdef3d(iff,clef_stations(iff), & 1456 o_vitv%flag,o_vitv%name, "Meridional wind", "m/s" ) 1457 CALL histdef3d(iff,clef_stations(iff), & 1458 o_vitw%flag,o_vitw%name, "Vertical wind", "Pa/s" ) 1459 CALL histdef3d(iff,clef_stations(iff), & 1460 o_pres%flag,o_pres%name, "Air pressure", "Pa" ) 1461 CALL histdef3d(iff,clef_stations(iff), & 1462 o_paprs%flag,o_paprs%name, "Air pressure Inter-Couches", "Pa" ) 1463 CALL histdef3d(iff,clef_stations(iff), & 1464 o_mass%flag,o_mass%name, "Masse Couches", "kg/m2" ) 1465 CALL histdef3d(iff,clef_stations(iff), & 1466 o_zfull%flag,o_zfull%name, "Altitude of full pressure levels", "m" ) 1467 CALL histdef3d(iff,clef_stations(iff), & 1468 o_zhalf%flag,o_zhalf%name, "Altitude of half pressure levels", "m" ) 1469 CALL histdef3d(iff,clef_stations(iff), & 1470 o_rneb%flag,o_rneb%name, "Cloud fraction", "-") 1471 CALL histdef3d(iff,clef_stations(iff), & 1472 o_rnebcon%flag,o_rnebcon%name, "Convective Cloud Fraction", "-") 1473 CALL histdef3d(iff,clef_stations(iff), & 1474 o_rnebls%flag,o_rnebls%name, "LS Cloud fraction", "-") 1475 CALL histdef3d(iff,clef_stations(iff), & 1476 o_rhum%flag,o_rhum%name, "Relative humidity", "-") 1477 CALL histdef3d(iff,clef_stations(iff), & 1478 o_ozone%flag,o_ozone%name, "Ozone mole fraction", "-") 1479 if (read_climoz == 2) & 1480 CALL histdef3d(iff,clef_stations(iff), & 1481 o_ozone_light%flag,o_ozone_light%name, & 1482 "Daylight ozone mole fraction", "-") 1483 CALL histdef3d(iff,clef_stations(iff), & 1484 o_dtphy%flag,o_dtphy%name, "Physics dT", "K/s") 1485 CALL histdef3d(iff,clef_stations(iff), & 1486 o_dqphy%flag,o_dqphy%name, "Physics dQ", "(kg/kg)/s") 1487 CALL histdef3d(iff,clef_stations(iff), & 1488 o_cldtau%flag,o_cldtau%name, "Cloud optical thickness", "1") 1489 CALL histdef3d(iff,clef_stations(iff), & 1490 o_cldemi%flag,o_cldemi%name, "Cloud optical emissivity", "1") 1491 !IM: bug ?? dimensionnement variables (klon,klev+1) pmflxr, pmflxs, prfl, psfl 1492 CALL histdef3d(iff,clef_stations(iff), & 1493 o_pr_con_l%flag,o_pr_con_l%name, "Convective precipitation lic", " ") 1494 CALL histdef3d(iff,clef_stations(iff), & 1495 o_pr_con_i%flag,o_pr_con_i%name, "Convective precipitation ice", " ") 1496 CALL histdef3d(iff,clef_stations(iff), & 1497 o_pr_lsc_l%flag,o_pr_lsc_l%name, "Large scale precipitation lic", " ") 1498 CALL histdef3d(iff,clef_stations(iff), & 1499 o_pr_lsc_i%flag,o_pr_lsc_i%name, "Large scale precipitation ice", " ") 1500 !Cloud droplet effective radius 1501 CALL histdef3d(iff,clef_stations(iff), & 1502 o_re%flag,o_re%name, "Cloud droplet effective radius","um") 1503 CALL histdef3d(iff,clef_stations(iff), & 1504 o_fl%flag,o_fl%name, "Denominator of Cloud droplet effective radius"," ") 1505 !FH Sorties pour la couche limite 1506 if (iflag_pbl>1) then 1507 CALL histdef3d(iff,clef_stations(iff), & 1508 o_tke%flag,o_tke%name, "TKE", "m2/s2") 1509 IF (.NOT.clef_stations(iff)) THEN 1510 ! 1511 !IM: there is no way to have one single value in a netcdf file 1512 ! 1513 type_ecri(1) = 't_max(X)' 1514 type_ecri(2) = 't_max(X)' 1515 type_ecri(3) = 't_max(X)' 1516 type_ecri(4) = 't_max(X)' 1517 type_ecri(5) = 't_max(X)' 1518 type_ecri(6) = 't_max(X)' 1519 CALL histdef3d(iff,clef_stations(iff), & 1520 o_tke_max%flag,o_tke_max%name, "TKE max", "m2/s2") 1521 ENDIF 1522 type_ecri(:) = type_ecri_files(:) 1523 endif 1524 1525 CALL histdef3d(iff,clef_stations(iff), & 1526 o_kz%flag,o_kz%name, "Kz melange", "m2/s") 1527 IF (.NOT.clef_stations(iff)) THEN 1528 ! 1529 !IM: there is no way to have one single value in a netcdf file 1530 ! 1531 type_ecri(1) = 't_max(X)' 1532 type_ecri(2) = 't_max(X)' 1533 type_ecri(3) = 't_max(X)' 1534 type_ecri(4) = 't_max(X)' 1535 type_ecri(5) = 't_max(X)' 1536 type_ecri(6) = 't_max(X)' 1537 CALL histdef3d(iff,clef_stations(iff), & 1538 o_kz_max%flag,o_kz_max%name, "Kz melange max", "m2/s" ) 1539 ENDIF 1540 type_ecri(:) = type_ecri_files(:) 1541 CALL histdef3d(iff,clef_stations(iff), & 1542 o_clwcon%flag,o_clwcon%name, "Convective Cloud Liquid water content", "kg/kg") 1543 CALL histdef3d(iff,clef_stations(iff), & 1544 o_dtdyn%flag,o_dtdyn%name, "Dynamics dT", "K/s") 1545 CALL histdef3d(iff,clef_stations(iff), & 1546 o_dqdyn%flag,o_dqdyn%name, "Dynamics dQ", "(kg/kg)/s") 1547 CALL histdef3d(iff,clef_stations(iff), & 1548 o_dudyn%flag,o_dudyn%name, "Dynamics dU", "m/s2") 1549 CALL histdef3d(iff,clef_stations(iff), & 1550 o_dvdyn%flag,o_dvdyn%name, "Dynamics dV", "m/s2") 1551 CALL histdef3d(iff,clef_stations(iff), & 1552 o_dtcon%flag,o_dtcon%name, "Convection dT", "K/s") 1553 CALL histdef3d(iff,clef_stations(iff), & 1554 o_ducon%flag,o_ducon%name, "Convection du", "m/s2") 1555 CALL histdef3d(iff,clef_stations(iff), & 1556 o_dvcon%flag,o_dvcon%name, "Convection dv", "m/s2") 1557 CALL histdef3d(iff,clef_stations(iff), & 1558 o_dqcon%flag,o_dqcon%name, "Convection dQ", "(kg/kg)/s") 1559 1560 ! Wakes 1561 IF(iflag_con.EQ.3) THEN 1562 IF (iflag_wake >= 1) THEN 1563 CALL histdef2d(iff,clef_stations(iff), & 1564 o_ale_wk%flag,o_ale_wk%name, "ALE WK", "m2/s2") 1565 CALL histdef2d(iff,clef_stations(iff), & 1566 o_alp_wk%flag,o_alp_wk%name, "ALP WK", "m2/s2") 1567 CALL histdef2d(iff,clef_stations(iff), & 1568 o_ale%flag,o_ale%name, "ALE", "m2/s2") 1569 CALL histdef2d(iff,clef_stations(iff), & 1570 o_alp%flag,o_alp%name, "ALP", "W/m2") 1571 CALL histdef2d(iff,clef_stations(iff),o_cin%flag,o_cin%name, "Convective INhibition", "m2/s2") 1572 CALL histdef2d(iff,clef_stations(iff),o_wape%flag,o_WAPE%name, "WAPE", "m2/s2") 1573 CALL histdef2d(iff,clef_stations(iff),o_wake_h%flag,o_wake_h%name, "wake_h", "-") 1574 CALL histdef2d(iff,clef_stations(iff),o_wake_s%flag,o_wake_s%name, "wake_s", "-") 1575 CALL histdef3d(iff,clef_stations(iff),o_dtwak%flag,o_dtwak%name, "Wake dT", "K/s") 1576 CALL histdef3d(iff,clef_stations(iff),o_dqwak%flag,o_dqwak%name, "Wake dQ", "(kg/kg)/s") 1577 CALL histdef3d(iff,clef_stations(iff),o_wake_deltat%flag,o_wake_deltat%name, "wake_deltat", " ") 1578 CALL histdef3d(iff,clef_stations(iff),o_wake_deltaq%flag,o_wake_deltaq%name, "wake_deltaq", " ") 1579 CALL histdef3d(iff,clef_stations(iff),o_wake_omg%flag,o_wake_omg%name, "wake_omg", " ") 1580 ENDIF 1581 !!! RomP CALL histdef3d(iff,clef_stations(iff),o_Vprecip%flag,o_Vprecip%name, "precipitation vertical profile", "-") 1582 CALL histdef3d(iff,clef_stations(iff),o_ftd%flag,o_ftd%name, "tend temp due aux descentes precip", "-") 1583 CALL histdef3d(iff,clef_stations(iff),o_fqd%flag,o_fqd%name,"tend vap eau due aux descentes precip", "-") 1584 ENDIF !(iflag_con.EQ.3) 1585 1586 IF(iflag_con.GE.3) THEN ! RomP >>> 1587 CALL histdef3d(iff,clef_stations(iff),o_wdtrainA%flag,o_wdtrainA%name, "precipitation from AA", "-") 1588 CALL histdef3d(iff,clef_stations(iff),o_wdtrainM%flag,o_wdtrainM%name, "precipitation from mixture", "-") 1589 CALL histdef3d(iff,clef_stations(iff),o_Vprecip%flag,o_Vprecip%name, "precipitation vertical profile", "-") 1590 ENDIF !(iflag_con.GE.3) ! <<< RomP 602 CALL histdef3d(iff,o_ec550aer) 603 CALL histdef3d(iff,o_lwcon) 604 CALL histdef3d(iff,o_iwcon) 605 CALL histdef3d(iff,o_temp) 606 CALL histdef3d(iff,o_theta) 607 CALL histdef3d(iff,o_ovap) 608 CALL histdef3d(iff,o_oliq) 609 CALL histdef3d(iff,o_ovapinit) 610 CALL histdef3d(iff,o_geop) 611 CALL histdef3d(iff,o_vitu) 612 CALL histdef3d(iff,o_vitv) 613 CALL histdef3d(iff,o_vitw) 614 CALL histdef3d(iff,o_pres) 615 CALL histdef3d(iff,o_paprs) 616 CALL histdef3d(iff,o_mass) 617 CALL histdef3d(iff,o_zfull) 618 CALL histdef3d(iff,o_zhalf) 619 CALL histdef3d(iff,o_rneb) 620 CALL histdef3d(iff,o_rnebcon) 621 CALL histdef3d(iff,o_rnebls) 622 CALL histdef3d(iff,o_rhum) 623 CALL histdef3d(iff,o_ozone) 624 625 IF (read_climoz == 2) THEN 626 CALL histdef3d(iff,o_ozone_light) 627 END IF 628 629 CALL histdef3d(iff,o_dtphy) 630 CALL histdef3d(iff,o_dqphy) 631 CALL histdef3d(iff,o_cldtau) 632 CALL histdef3d(iff,o_cldemi) 633 !IM: bug ?? dimensionnement variables (klon,klev+1) pmflxr, pmflxs, prfl, psfl 634 CALL histdef3d(iff,o_pr_con_l) 635 CALL histdef3d(iff,o_pr_con_i) 636 CALL histdef3d(iff,o_pr_lsc_l) 637 CALL histdef3d(iff,o_pr_lsc_i) 638 !Cloud droplet effective radius 639 CALL histdef3d(iff,o_re) 640 CALL histdef3d(iff,o_fl) 641 !FH Sorties pour la couche limite 642 IF (iflag_pbl>1) THEN 643 CALL histdef3d(iff,o_tke) 644 CALL histdef3d(iff,o_tke_max) 645 ENDIF 646 CALL histdef3d(iff,o_kz) 647 CALL histdef3d(iff,o_kz_max) 648 CALL histdef3d(iff,o_clwcon) 649 CALL histdef3d(iff,o_dtdyn) 650 CALL histdef3d(iff,o_dqdyn) 651 CALL histdef3d(iff,o_dudyn) 652 CALL histdef3d(iff,o_dvdyn) 653 CALL histdef3d(iff,o_dtcon) 654 CALL histdef3d(iff,o_ducon) 655 CALL histdef3d(iff,o_dvcon) 656 CALL histdef3d(iff,o_dqcon) 657 658 ! Wakes 659 IF(iflag_con.EQ.3) THEN 660 IF (iflag_wake >= 1) THEN 661 CALL histdef2d(iff,o_ale_wk) 662 CALL histdef2d(iff,o_alp_wk) 663 CALL histdef2d(iff,o_ale) 664 CALL histdef2d(iff,o_alp) 665 CALL histdef2d(iff,o_cin) 666 CALL histdef2d(iff,o_wape) 667 CALL histdef2d(iff,o_wake_h) 668 CALL histdef2d(iff,o_wake_s) 669 CALL histdef3d(iff,o_dtwak) 670 CALL histdef3d(iff,o_dqwak) 671 CALL histdef3d(iff,o_wake_deltat) 672 CALL histdef3d(iff,o_wake_deltaq) 673 CALL histdef3d(iff,o_wake_omg) 674 ENDIF 675 !!! RomP CALL histdef3d(iff,o_Vprecip%flag,o_Vprecip%name, "precipitation vertical profile", "-") 676 CALL histdef3d(iff,o_ftd) 677 CALL histdef3d(iff,o_fqd) 678 ENDIF !(iflag_con.EQ.3) 679 680 IF(iflag_con.GE.3) THEN ! RomP >>> 681 CALL histdef3d(iff,o_wdtrainA) 682 CALL histdef3d(iff,o_wdtrainM) 683 CALL histdef3d(iff,o_Vprecip) 684 ENDIF !(iflag_con.GE.3) ! <<< RomP 1591 685 1592 686 !!! nrlmd le 10/04/2012 1593 687 1594 IF (iflag_trig_bl>=1) THEN 1595 CALL histdef2d(iff,clef_stations(iff),o_n2%flag,o_n2%name, "Nombre de panaches de type 2", " ") 1596 CALL histdef2d(iff,clef_stations(iff),o_s2%flag,o_s2%name, "Surface moyenne des panaches de type 2", "m2") 1597 1598 CALL histdef2d(iff,clef_stations(iff),o_proba_notrig%flag,o_proba_notrig%name, "Probabilité de non-déclenchement", " ") 1599 CALL histdef2d(iff,clef_stations(iff),o_random_notrig%flag,o_random_notrig%name, "Tirage aléatoire de non-déclenchement", " ") 1600 CALL histdef2d(iff,clef_stations(iff),o_ale_bl_trig%flag,o_ale_bl_trig%name, "ALE_BL_STAT + Condition P>Pseuil", "m2/s2") 1601 CALL histdef2d(iff,clef_stations(iff),o_ale_bl_stat%flag,o_ale_bl_stat%name, "ALE_BL_STAT", "m2/s2") 1602 ENDIF !(iflag_trig_bl>=1) 1603 1604 IF (iflag_clos_bl>=1) THEN 1605 CALL histdef2d(iff,clef_stations(iff),o_alp_bl_det%flag,o_alp_bl_det%name, "ALP_BL_DET", "W/m2") 1606 CALL histdef2d(iff,clef_stations(iff),o_alp_bl_fluct_m%flag,o_alp_bl_fluct_m%name, "ALP_BL_FLUCT_M", "W/m2") 1607 CALL histdef2d(iff,clef_stations(iff),o_alp_bl_fluct_tke%flag,o_alp_bl_fluct_tke%name, "ALP_BL_FLUCT_TKE", "W/m2") 1608 CALL histdef2d(iff,clef_stations(iff),o_alp_bl_conv%flag,o_alp_bl_conv%name, "ALP_BL_CONV", "W/m2") 1609 CALL histdef2d(iff,clef_stations(iff),o_alp_bl_stat%flag,o_alp_bl_stat%name, "ALP_BL_STAT", "W/m2") 1610 ENDIF !(iflag_clos_bl>=1) 688 IF (iflag_trig_bl>=1) THEN 689 CALL histdef2d(iff,o_n2) 690 CALL histdef2d(iff,o_s2) 691 CALL histdef2d(iff,o_proba_notrig) 692 CALL histdef2d(iff,o_random_notrig) 693 CALL histdef2d(iff,o_ale_bl_trig) 694 CALL histdef2d(iff,o_ale_bl_stat) 695 ENDIF !(iflag_trig_bl>=1) 696 697 IF (iflag_clos_bl>=1) THEN 698 CALL histdef2d(iff,o_alp_bl_det) 699 CALL histdef2d(iff,o_alp_bl_fluct_m) 700 CALL histdef2d(iff,o_alp_bl_fluct_tke) 701 CALL histdef2d(iff,o_alp_bl_conv) 702 CALL histdef2d(iff,o_alp_bl_stat) 703 ENDIF !(iflag_clos_bl>=1) 1611 704 1612 705 !!! fin nrlmd le 10/04/2012 1613 1614 CALL histdef3d(iff,clef_stations(iff),o_dtlsc%flag,o_dtlsc%name, "Condensation dT", "K/s") 1615 CALL histdef3d(iff,clef_stations(iff),o_dtlschr%flag,o_dtlschr%name,"Large-scale condensational heating rate","K/s") 1616 CALL histdef3d(iff,clef_stations(iff),o_dqlsc%flag,o_dqlsc%name, "Condensation dQ", "(kg/kg)/s") 1617 CALL histdef3d(iff,clef_stations(iff),o_beta_prec%flag,o_beta_prec%name, "LS Conversion rate to prec", "(kg/kg)/s") 1618 CALL histdef3d(iff,clef_stations(iff),o_dtvdf%flag,o_dtvdf%name, "Boundary-layer dT", "K/s") 1619 CALL histdef3d(iff,clef_stations(iff),o_dqvdf%flag,o_dqvdf%name, "Boundary-layer dQ", "(kg/kg)/s") 1620 CALL histdef3d(iff,clef_stations(iff),o_dteva%flag,o_dteva%name, "Reevaporation dT", "K/s") 1621 CALL histdef3d(iff,clef_stations(iff),o_dqeva%flag,o_dqeva%name, "Reevaporation dQ", "(kg/kg)/s") 1622 CALL histdef3d(iff,clef_stations(iff),o_ptconv%flag,o_ptconv%name, "POINTS CONVECTIFS", " ") 1623 CALL histdef3d(iff,clef_stations(iff),o_ratqs%flag,o_ratqs%name, "RATQS", " ") 1624 CALL histdef3d(iff,clef_stations(iff),o_dtthe%flag,o_dtthe%name, "Thermal dT", "K/s") 1625 1626 if(iflag_thermals.ge.1) THEN 1627 CALL histdef3d(iff,clef_stations(iff),o_dqlscth%flag,o_dqlscth%name, "dQ therm.", "(kg/kg)/s") 1628 CALL histdef3d(iff,clef_stations(iff),o_dqlscst%flag,o_dqlscst%name, "dQ strat.", "(kg/kg)/s") 1629 CALL histdef3d(iff,clef_stations(iff),o_dtlscth%flag,o_dtlscth%name, "dQ therm.", "K/s") 1630 CALL histdef3d(iff,clef_stations(iff),o_dtlscst%flag,o_dtlscst%name, "dQ strat.", "K/s") 1631 CALL histdef2d(iff,clef_stations(iff),o_plulth%flag,o_plulth%name, "Rainfall therm.", "K/s") 1632 CALL histdef2d(iff,clef_stations(iff),o_plulst%flag,o_plulst%name, "Rainfall strat.", "K/s") 1633 CALL histdef2d(iff,clef_stations(iff),o_lmaxth%flag,o_lmaxth%name, "Upper level thermals", "") 1634 CALL histdef3d(iff,clef_stations(iff),o_ptconvth%flag,o_ptconvth%name, "POINTS CONVECTIFS therm.", " ") 1635 CALL histdef3d(iff,clef_stations(iff),o_f_th%flag,o_f_th%name, "Thermal plume mass flux", "kg/(m2*s)") 1636 CALL histdef3d(iff,clef_stations(iff),o_e_th%flag,o_e_th%name,"Thermal plume entrainment","K/s") 1637 CALL histdef3d(iff,clef_stations(iff),o_w_th%flag,o_w_th%name,"Thermal plume vertical velocity","m/s") 1638 CALL histdef2d(iff,clef_stations(iff), & 1639 o_ftime_th%flag,o_ftime_th%name,"Fraction of time Shallow convection occurs"," ") 1640 CALL histdef3d(iff,clef_stations(iff), & 1641 o_q_th%flag,o_q_th%name, "Thermal plume total humidity", "kg/kg") 1642 CALL histdef3d(iff,clef_stations(iff), & 1643 o_a_th%flag,o_a_th%name, "Thermal plume fraction", "") 1644 CALL histdef3d(iff,clef_stations(iff), & 1645 o_d_th%flag,o_d_th%name, "Thermal plume detrainment", "K/s") 1646 1647 CALL histdef2d(iff,clef_stations(iff), & 1648 o_f0_th%flag,o_f0_th%name, "Thermal closure mass flux", "K/s") 1649 CALL histdef2d(iff,clef_stations(iff), & 1650 o_zmax_th%flag,o_zmax_th%name, "Thermal plume height", "K/s") 1651 CALL histdef3d(iff,clef_stations(iff), & 1652 o_dqthe%flag,o_dqthe%name, "Thermal dQ", "(kg/kg)/s") 1653 endif !iflag_thermals.ge.1 1654 CALL histdef3d(iff,clef_stations(iff), & 1655 o_dtajs%flag,o_dtajs%name, "Dry adjust. dT", "K/s") 1656 CALL histdef3d(iff,clef_stations(iff), & 1657 o_dqajs%flag,o_dqajs%name, "Dry adjust. dQ", "(kg/kg)/s") 1658 CALL histdef3d(iff,clef_stations(iff), & 1659 o_dtswr%flag,o_dtswr%name, "SW radiation dT", "K/s") 1660 CALL histdef3d(iff,clef_stations(iff), & 1661 o_dtsw0%flag,o_dtsw0%name, "CS SW radiation dT", "K/s") 1662 CALL histdef3d(iff,clef_stations(iff), & 1663 o_dtlwr%flag,o_dtlwr%name, "LW radiation dT", "K/s") 1664 CALL histdef3d(iff,clef_stations(iff), & 1665 o_dtlw0%flag,o_dtlw0%name, "CS LW radiation dT", "K/s") 1666 CALL histdef3d(iff,clef_stations(iff), & 1667 o_dtec%flag,o_dtec%name, "Cinetic dissip dT", "K/s") 1668 CALL histdef3d(iff,clef_stations(iff), & 1669 o_duvdf%flag,o_duvdf%name, "Boundary-layer dU", "m/s2") 1670 CALL histdef3d(iff,clef_stations(iff), & 1671 o_dvvdf%flag,o_dvvdf%name, "Boundary-layer dV", "m/s2") 1672 1673 IF (ok_orodr) THEN 1674 CALL histdef3d(iff,clef_stations(iff), & 1675 o_duoro%flag,o_duoro%name, "Orography dU", "m/s2") 1676 CALL histdef3d(iff,clef_stations(iff), & 1677 o_dvoro%flag,o_dvoro%name, "Orography dV", "m/s2") 1678 CALL histdef3d(iff,clef_stations(iff), & 1679 o_dtoro%flag,o_dtoro%name, "Orography dT", "K/s") 1680 ENDIF 1681 1682 IF (ok_orolf) THEN 1683 CALL histdef3d(iff,clef_stations(iff), & 1684 o_dulif%flag,o_dulif%name, "Orography dU", "m/s2") 1685 CALL histdef3d(iff,clef_stations(iff), & 1686 o_dvlif%flag,o_dvlif%name, "Orography dV", "m/s2") 1687 CALL histdef3d(iff,clef_stations(iff), & 1688 o_dtlif%flag,o_dtlif%name, "Orography dT", "K/s") 1689 ENDIF 1690 1691 IF (ok_hines) then 1692 CALL histdef3d(iff,clef_stations(iff), & 1693 o_duhin%flag,o_duhin%name, "Hines GWD dU", "m/s2") 1694 CALL histdef3d(iff,clef_stations(iff), & 1695 o_dvhin%flag,o_dvhin%name, "Hines GWD dV", "m/s2") 1696 1697 CALL histdef3d(iff,clef_stations(iff), & 1698 o_dthin%flag,o_dthin%name, "Hines GWD dT", "K/s") 1699 ENDIF 1700 1701 CALL histdef3d(iff,clef_stations(iff), & 1702 o_rsu%flag,o_rsu%name, "SW upward radiation", "W m-2") 1703 CALL histdef3d(iff,clef_stations(iff), & 1704 o_rsd%flag,o_rsd%name, "SW downward radiation", "W m-2") 1705 CALL histdef3d(iff,clef_stations(iff), & 1706 o_rlu%flag,o_rlu%name, "LW upward radiation", "W m-2") 1707 CALL histdef3d(iff,clef_stations(iff), & 1708 o_rld%flag,o_rld%name, "LW downward radiation", "W m-2") 1709 1710 CALL histdef3d(iff,clef_stations(iff), & 1711 o_rsucs%flag,o_rsucs%name, "SW CS upward radiation", "W m-2") 1712 CALL histdef3d(iff,clef_stations(iff), & 1713 o_rsdcs%flag,o_rsdcs%name, "SW CS downward radiation", "W m-2") 1714 CALL histdef3d(iff,clef_stations(iff), & 1715 o_rlucs%flag,o_rlucs%name, "LW CS upward radiation", "W m-2") 1716 CALL histdef3d(iff,clef_stations(iff), & 1717 o_rldcs%flag,o_rldcs%name, "LW CS downward radiation", "W m-2") 1718 1719 CALL histdef3d(iff,clef_stations(iff), & 1720 o_tnt%flag,o_tnt%name, "Tendency of air temperature", "K s-1") 1721 1722 CALL histdef3d(iff,clef_stations(iff), & 1723 o_tntc%flag,o_tntc%name, "Tendency of air temperature due to Moist Convection", & 1724 "K s-1") 1725 1726 CALL histdef3d(iff,clef_stations(iff), & 1727 o_tntr%flag,o_tntr%name, "Air temperature tendency due to Radiative heating", & 1728 "K s-1") 1729 1730 CALL histdef3d(iff,clef_stations(iff), & 1731 o_tntscpbl%flag,o_tntscpbl%name, "Air temperature tendency due to St cloud and precipitation and BL mixing", & 1732 "K s-1") 1733 1734 CALL histdef3d(iff,clef_stations(iff), & 1735 o_tnhus%flag,o_tnhus%name, "Tendency of specific humidity", "s-1") 1736 1737 CALL histdef3d(iff,clef_stations(iff), & 1738 o_tnhusc%flag,o_tnhusc%name, "Tendency of specific humidity due to convection", "s-1") 1739 1740 CALL histdef3d(iff,clef_stations(iff), & 1741 o_tnhusscpbl%flag,o_tnhusscpbl%name, "Tendency of Specific humidity due to ST cl, precip and BL mixing", & 1742 "s-1") 1743 1744 CALL histdef3d(iff,clef_stations(iff), & 1745 o_evu%flag,o_evu%name, "Eddy viscosity coefficient for Momentum Variables", "m2 s-1") 1746 1747 CALL histdef3d(iff,clef_stations(iff), & 1748 o_h2o%flag,o_h2o%name, "Mass Fraction of Water", "1") 1749 1750 CALL histdef3d(iff,clef_stations(iff), & 1751 o_mcd%flag,o_mcd%name, "Downdraft COnvective Mass Flux", "kg/(m2*s)") 1752 1753 CALL histdef3d(iff,clef_stations(iff), & 1754 o_dmc%flag,o_dmc%name, "Deep COnvective Mass Flux", "kg/(m2*s)") 1755 1756 CALL histdef3d(iff,clef_stations(iff), & 1757 o_ref_liq%flag,o_ref_liq%name, "Effective radius of convective cloud liquid water particle", "m") 1758 1759 CALL histdef3d(iff,clef_stations(iff), & 1760 o_ref_ice%flag,o_ref_ice%name, "Effective radius of startiform cloud ice particle", "m") 1761 1762 if (RCO2_per.NE.RCO2_act.OR.RCH4_per.NE.RCH4_act.OR. & 706 CALL histdef3d(iff,o_dtlsc) 707 CALL histdef3d(iff,o_dtlschr) 708 CALL histdef3d(iff,o_dqlsc) 709 CALL histdef3d(iff,o_beta_prec) 710 CALL histdef3d(iff,o_dtvdf) 711 CALL histdef3d(iff,o_dtdis) 712 CALL histdef3d(iff,o_dqvdf) 713 CALL histdef3d(iff,o_dteva) 714 CALL histdef3d(iff,o_dqeva) 715 CALL histdef3d(iff,o_ptconv) 716 CALL histdef3d(iff,o_ratqs) 717 CALL histdef3d(iff,o_dtthe) 718 719 IF (iflag_thermals.ge.1) THEN 720 CALL histdef3d(iff,o_dqlscth) 721 CALL histdef3d(iff,o_dqlscst) 722 CALL histdef3d(iff,o_dtlscth) 723 CALL histdef3d(iff,o_dtlscst) 724 CALL histdef2d(iff,o_plulth) 725 CALL histdef2d(iff,o_plulst) 726 CALL histdef2d(iff,o_lmaxth) 727 CALL histdef3d(iff,o_ptconvth) 728 CALL histdef3d(iff,o_f_th) 729 CALL histdef3d(iff,o_e_th) 730 CALL histdef3d(iff,o_w_th) 731 CALL histdef3d(iff,o_lambda_th) 732 CALL histdef2d(iff,o_ftime_th) 733 CALL histdef3d(iff,o_q_th) 734 CALL histdef3d(iff,o_a_th) 735 CALL histdef3d(iff,o_d_th) 736 CALL histdef2d(iff,o_f0_th) 737 CALL histdef2d(iff,o_zmax_th) 738 CALL histdef3d(iff,o_dqthe) 739 ENDIF !iflag_thermals.ge.1 740 741 CALL histdef3d(iff,o_dtajs) 742 CALL histdef3d(iff,o_dqajs) 743 CALL histdef3d(iff,o_dtswr) 744 CALL histdef3d(iff,o_dtsw0) 745 CALL histdef3d(iff,o_dtlwr) 746 CALL histdef3d(iff,o_dtlw0) 747 CALL histdef3d(iff,o_dtec) 748 CALL histdef3d(iff,o_duvdf) 749 CALL histdef3d(iff,o_dvvdf) 750 751 IF (ok_orodr) THEN 752 CALL histdef3d(iff,o_duoro) 753 CALL histdef3d(iff,o_dvoro) 754 CALL histdef3d(iff,o_dtoro) 755 ENDIF 756 757 IF (ok_orolf) THEN 758 CALL histdef3d(iff,o_dulif) 759 CALL histdef3d(iff,o_dvlif) 760 CALL histdef3d(iff,o_dtlif) 761 ENDIF 762 763 IF (ok_hines) then 764 CALL histdef3d(iff,o_duhin) 765 CALL histdef3d(iff,o_dvhin) 766 CALL histdef3d(iff,o_dthin) 767 ENDIF 768 769 CALL histdef3d(iff,o_rsu) 770 CALL histdef3d(iff,o_rsd) 771 CALL histdef3d(iff,o_rlu) 772 CALL histdef3d(iff,o_rld) 773 CALL histdef3d(iff,o_rsucs) 774 CALL histdef3d(iff,o_rsdcs) 775 CALL histdef3d(iff,o_rlucs) 776 CALL histdef3d(iff,o_rldcs) 777 CALL histdef3d(iff,o_tnt) 778 CALL histdef3d(iff,o_tntc) 779 CALL histdef3d(iff,o_tntr) 780 CALL histdef3d(iff,o_tntscpbl) 781 CALL histdef3d(iff,o_tnhus) 782 CALL histdef3d(iff,o_tnhusc) 783 CALL histdef3d(iff,o_tnhusscpbl) 784 CALL histdef3d(iff,o_evu) 785 CALL histdef3d(iff,o_h2o) 786 CALL histdef3d(iff,o_mcd) 787 CALL histdef3d(iff,o_dmc) 788 CALL histdef3d(iff,o_ref_liq) 789 CALL histdef3d(iff,o_ref_ice) 790 791 IF (RCO2_per.NE.RCO2_act.OR.RCH4_per.NE.RCH4_act.OR. & 1763 792 RN2O_per.NE.RN2O_act.OR.RCFC11_per.NE.RCFC11_act.OR. & 1764 793 RCFC12_per.NE.RCFC12_act) THEN 1765 1766 CALL histdef2d(iff,clef_stations(iff),o_rsut4co2%flag,o_rsut4co2%name, & 1767 "TOA Out SW in 4xCO2 atmosphere", "W/m2") 1768 CALL histdef2d(iff,clef_stations(iff),o_rlut4co2%flag,o_rlut4co2%name, & 1769 "TOA Out LW in 4xCO2 atmosphere", "W/m2") 1770 CALL histdef2d(iff,clef_stations(iff),o_rsutcs4co2%flag,o_rsutcs4co2%name, & 1771 "TOA Out CS SW in 4xCO2 atmosphere", "W/m2") 1772 CALL histdef2d(iff,clef_stations(iff),o_rlutcs4co2%flag,o_rlutcs4co2%name, & 1773 "TOA Out CS LW in 4xCO2 atmosphere", "W/m2") 1774 1775 CALL histdef3d(iff,clef_stations(iff),o_rsu4co2%flag,o_rsu4co2%name, & 1776 "Upwelling SW 4xCO2 atmosphere", "W/m2") 1777 CALL histdef3d(iff,clef_stations(iff),o_rlu4co2%flag,o_rlu4co2%name, & 1778 "Upwelling LW 4xCO2 atmosphere", "W/m2") 1779 CALL histdef3d(iff,clef_stations(iff),o_rsucs4co2%flag,o_rsucs4co2%name, & 1780 "Upwelling CS SW 4xCO2 atmosphere", "W/m2") 1781 CALL histdef3d(iff,clef_stations(iff),o_rlucs4co2%flag,o_rlucs4co2%name, & 1782 "Upwelling CS LW 4xCO2 atmosphere", "W/m2") 1783 1784 CALL histdef3d(iff,clef_stations(iff),o_rsd4co2%flag,o_rsd4co2%name, & 1785 "Downwelling SW 4xCO2 atmosphere", "W/m2") 1786 CALL histdef3d(iff,clef_stations(iff),o_rld4co2%flag,o_rld4co2%name, & 1787 "Downwelling LW 4xCO2 atmosphere", "W/m2") 1788 CALL histdef3d(iff,clef_stations(iff),o_rsdcs4co2%flag,o_rsdcs4co2%name, & 1789 "Downwelling CS SW 4xCO2 atmosphere", "W/m2") 1790 CALL histdef3d(iff,clef_stations(iff),o_rldcs4co2%flag,o_rldcs4co2%name, & 1791 "Downwelling CS LW 4xCO2 atmosphere", "W/m2") 1792 1793 endif 1794 1795 1796 IF (nqtot>=3) THEN 1797 DO iq=3,nqtot 1798 iiq=niadv(iq) 1799 o_trac(iq-2) = ctrl_out((/ 4, 5, 1, 1, 1, 10 /),tname(iiq)) 1800 CALL histdef3d (iff,clef_stations(iff), & 1801 o_trac(iq-2)%flag,o_trac(iq-2)%name,'Tracer '//ttext(iiq), "-" ) 1802 o_trac_cum(iq-2) = ctrl_out((/ 3, 4, 10, 10, 10, 10 /),'cum'//tname(iiq)) 1803 CALL histdef2d (iff,clef_stations(iff), & 1804 o_trac_cum(iq-2)%flag,o_trac_cum(iq-2)%name,'Cumulated tracer '//ttext(iiq), "-" ) 1805 ENDDO 1806 ENDIF 1807 1808 CALL histend(nid_files(iff)) 1809 1810 ndex2d = 0 1811 ndex3d = 0 1812 1813 ENDIF ! clef_files 794 CALL histdef2d(iff,o_rsut4co2) 795 CALL histdef2d(iff,o_rlut4co2) 796 CALL histdef2d(iff,o_rsutcs4co2) 797 CALL histdef2d(iff,o_rlutcs4co2) 798 CALL histdef3d(iff,o_rsu4co2) 799 CALL histdef3d(iff,o_rlu4co2) 800 CALL histdef3d(iff,o_rsucs4co2) 801 CALL histdef3d(iff,o_rlucs4co2) 802 CALL histdef3d(iff,o_rsd4co2) 803 CALL histdef3d(iff,o_rld4co2) 804 CALL histdef3d(iff,o_rsdcs4co2) 805 CALL histdef3d(iff,o_rldcs4co2) 806 807 ENDIF 808 809 810 IF (nqtot>=3) THEN 811 DO iq=3,nqtot 812 iiq=niadv(iq) 813 o_trac(iq-2) = ctrl_out((/ 4, 5, 1, 1, 1, 10 /),tname(iiq),'Tracer '//ttext(iiq), "-",& 814 (/ '', '', '', '', '', '' /)) 815 CALL histdef3d(iff, o_trac(iq-2)) 816 o_trac_cum(iq-2) = ctrl_out((/ 3, 4, 10, 10, 10, 10 /),'cum'//tname(iiq),& 817 'Cumulated tracer '//ttext(iiq), "-", (/ '', '', '', '', '', '' /)) 818 CALL histdef2d(iff, o_trac_cum(iq-2)) 819 ENDDO 820 ENDIF 821 822 CALL histend(nid_files(iff)) 823 824 ndex2d = 0 825 ndex3d = 0 826 827 ENDIF ! clef_files 1814 828 1815 829 ENDDO ! iff … … 1824 838 ecrit_ins = ecrit_files(6) 1825 839 1826 write(lunout,*)'swaero_diag=',swaero_diag1827 write(lunout,*)'Fin phys_output_mod.F90'1828 end subroutinephys_output_open1829 1830 SUBROUTINE histdef2d (iff,lpoint,flag_var,nomvar,titrevar,unitvar)1831 1832 useioipsl840 WRITE(lunout,*)'swaero_diag=',swaero_diag 841 WRITE(lunout,*)'Fin phys_output_mod.F90' 842 end SUBROUTINE phys_output_open 843 844 SUBROUTINE histdef2d_old (iff,lpoint,flag_var,nomvar,titrevar,unitvar) 845 846 USE ioipsl 1833 847 USE dimphy 1834 848 USE mod_phys_lmdz_para … … 1837 851 IMPLICIT NONE 1838 852 1839 include "dimensions.h" 1840 include "temps.h" 1841 include "indicesol.h" 1842 include "clesphys.h" 1843 1844 integer :: iff 1845 logical :: lpoint 1846 integer, dimension(nfiles) :: flag_var 1847 character(len=20) :: nomvar 1848 character(len=*) :: titrevar 1849 character(len=*) :: unitvar 1850 1851 real zstophym 1852 1853 if (type_ecri(iff)=='inst(X)'.OR.type_ecri(iff)=='once') then 853 INCLUDE "dimensions.h" 854 INCLUDE "temps.h" 855 INCLUDE "clesphys.h" 856 857 INTEGER :: iff 858 LOGICAL :: lpoint 859 INTEGER, DIMENSION(nfiles) :: flag_var 860 CHARACTER(LEN=20) :: nomvar 861 CHARACTER(LEN=*) :: titrevar 862 CHARACTER(LEN=*) :: unitvar 863 864 REAL zstophym 865 866 IF (type_ecri(iff)=='inst(X)'.OR.type_ecri(iff)=='once') THEN 1854 867 zstophym=zoutm(iff) 1855 else868 ELSE 1856 869 zstophym=zdtime 1857 endif870 ENDIF 1858 871 1859 872 ! Appel a la lecture des noms et niveau d'ecriture des variables dans output.def 1860 callconf_physoutputs(nomvar,flag_var)1861 1862 if(.NOT.lpoint) THEN1863 if ( flag_var(iff)<=lev_files(iff) ) then1864 callhistdef (nid_files(iff),nomvar,titrevar,unitvar, &873 CALL conf_physoutputs(nomvar,flag_var) 874 875 IF(.NOT.lpoint) THEN 876 IF ( flag_var(iff)<=lev_files(iff) ) THEN 877 CALL histdef (nid_files(iff),nomvar,titrevar,unitvar, & 1865 878 iim,jj_nb,nhorim(iff), 1,1,1, -99, 32, & 1866 879 type_ecri(iff), zstophym,zoutm(iff)) 1867 endif1868 else1869 if ( flag_var(iff)<=lev_files(iff) ) then1870 callhistdef (nid_files(iff),nomvar,titrevar,unitvar, &880 ENDIF 881 ELSE 882 IF ( flag_var(iff)<=lev_files(iff) ) THEN 883 CALL histdef (nid_files(iff),nomvar,titrevar,unitvar, & 1871 884 npstn,1,nhorim(iff), 1,1,1, -99, 32, & 1872 885 type_ecri(iff), zstophym,zoutm(iff)) 1873 endif1874 endif886 ENDIF 887 ENDIF 1875 888 1876 889 ! Set swaero_diag=true if at least one of the concerned variables are defined 1877 if(nomvar=='topswad' .OR. nomvar=='topswai' .OR. nomvar=='solswad' .OR. nomvar=='solswai' ) THEN1878 if ( flag_var(iff)<=lev_files(iff) ) then890 IF (nomvar=='topswad' .OR. nomvar=='topswai' .OR. nomvar=='solswad' .OR. nomvar=='solswai' ) THEN 891 IF ( flag_var(iff)<=lev_files(iff) ) THEN 1879 892 swaero_diag=.TRUE. 1880 end if1881 end if1882 end subroutine histdef2d1883 1884 SUBROUTINE histdef 3d (iff,lpoint,flag_var,nomvar,titrevar,unitvar)1885 1886 useioipsl893 END IF 894 END IF 895 END SUBROUTINE histdef2d_old 896 897 SUBROUTINE histdef2d (iff,var) 898 899 USE ioipsl 1887 900 USE dimphy 1888 901 USE mod_phys_lmdz_para … … 1891 904 IMPLICIT NONE 1892 905 1893 include "dimensions.h" 1894 include "temps.h" 1895 include "indicesol.h" 1896 include "clesphys.h" 1897 1898 integer :: iff 1899 logical :: lpoint 1900 integer, dimension(nfiles) :: flag_var 1901 character(len=20) :: nomvar 1902 character(len=*) :: titrevar 1903 character(len=*) :: unitvar 1904 1905 real zstophym 906 INCLUDE "dimensions.h" 907 INCLUDE "temps.h" 908 INCLUDE "clesphys.h" 909 910 INTEGER :: iff 911 TYPE(ctrl_out) :: var 912 913 REAL zstophym 914 CHARACTER(LEN=20) :: typeecrit 915 916 ! ug On récupère le type écrit de la structure: 917 ! Assez moche, à refaire si meilleure méthode... 918 IF (INDEX(var%type_ecrit(iff), "once") > 0) THEN 919 typeecrit = 'once' 920 ELSE IF(INDEX(var%type_ecrit(iff), "t_min") > 0) THEN 921 typeecrit = 't_min(X)' 922 ELSE IF(INDEX(var%type_ecrit(iff), "t_max") > 0) THEN 923 typeecrit = 't_max(X)' 924 ELSE IF(INDEX(var%type_ecrit(iff), "inst") > 0) THEN 925 typeecrit = 'inst(X)' 926 ELSE 927 typeecrit = type_ecri_files(iff) 928 ENDIF 929 930 IF (typeecrit=='inst(X)'.OR.typeecrit=='once') THEN 931 zstophym=zoutm(iff) 932 ELSE 933 zstophym=zdtime 934 ENDIF 1906 935 1907 936 ! Appel a la lecture des noms et niveau d'ecriture des variables dans output.def 1908 call conf_physoutputs(nomvar,flag_var) 1909 1910 if (type_ecri(iff)=='inst(X)'.OR.type_ecri(iff)=='once') then 937 CALL conf_physoutputs(var%name, var%flag) 938 939 IF(.NOT.clef_stations(iff)) THEN 940 IF ( var%flag(iff)<=lev_files(iff) ) THEN 941 CALL histdef (nid_files(iff), var%name, var%description, var%unit, & 942 iim,jj_nb,nhorim(iff), 1,1,1, -99, 32, & 943 typeecrit, zstophym,zoutm(iff)) 944 ENDIF 945 ELSE 946 IF ( var%flag(iff)<=lev_files(iff)) THEN 947 CALL histdef (nid_files(iff), var%name, var%description, var%unit, & 948 npstn,1,nhorim(iff), 1,1,1, -99, 32, & 949 typeecrit, zstophym,zoutm(iff)) 950 ENDIF 951 ENDIF 952 953 ! Set swaero_diag=true if at least one of the concerned variables are defined 954 IF (var%name=='topswad' .OR. var%name=='topswai' .OR. var%name=='solswad' .OR. var%name=='solswai' ) THEN 955 IF ( var%flag(iff)<=lev_files(iff) ) THEN 956 swaero_diag=.TRUE. 957 END IF 958 END IF 959 END SUBROUTINE histdef2d 960 961 SUBROUTINE histdef3d_old (iff,lpoint,flag_var,nomvar,titrevar,unitvar) 962 963 USE ioipsl 964 USE dimphy 965 USE mod_phys_lmdz_para 966 USE iophy 967 968 IMPLICIT NONE 969 970 INCLUDE "dimensions.h" 971 INCLUDE "temps.h" 972 ! INCLUDE "indicesol.h" 973 INCLUDE "clesphys.h" 974 975 INTEGER :: iff 976 LOGICAL :: lpoint 977 INTEGER, DIMENSION(nfiles) :: flag_var 978 CHARACTER(LEN=20) :: nomvar 979 CHARACTER(LEN=*) :: titrevar 980 CHARACTER(LEN=*) :: unitvar 981 982 REAL zstophym 983 984 ! Appel a la lecture des noms et niveau d'ecriture des variables dans output.def 985 CALL conf_physoutputs(nomvar,flag_var) 986 987 IF (type_ecri(iff)=='inst(X)'.OR.type_ecri(iff)=='once') THEN 1911 988 zstophym=zoutm(iff) 1912 else989 ELSE 1913 990 zstophym=zdtime 1914 endif1915 1916 if(.NOT.lpoint) THEN1917 if ( flag_var(iff)<=lev_files(iff) ) then1918 callhistdef (nid_files(iff), nomvar, titrevar, unitvar, &991 ENDIF 992 993 IF(.NOT.lpoint) THEN 994 IF ( flag_var(iff)<=lev_files(iff) ) THEN 995 CALL histdef (nid_files(iff), nomvar, titrevar, unitvar, & 1919 996 iim, jj_nb, nhorim(iff), klev, levmin(iff), & 1920 997 levmax(iff)-levmin(iff)+1, nvertm(iff), 32, type_ecri(iff), & 1921 998 zstophym, zoutm(iff)) 1922 endif1923 else1924 if ( flag_var(iff)<=lev_files(iff) ) then1925 callhistdef (nid_files(iff), nomvar, titrevar, unitvar, &999 ENDIF 1000 ELSE 1001 IF ( flag_var(iff)<=lev_files(iff) ) THEN 1002 CALL histdef (nid_files(iff), nomvar, titrevar, unitvar, & 1926 1003 npstn,1,nhorim(iff), klev, levmin(iff), & 1927 1004 levmax(iff)-levmin(iff)+1, nvertm(iff), 32, & 1928 1005 type_ecri(iff), zstophym,zoutm(iff)) 1929 endif 1930 endif 1931 end subroutine histdef3d 1006 ENDIF 1007 ENDIF 1008 END SUBROUTINE histdef3d_old 1009 1010 SUBROUTINE histdef3d (iff,var) 1011 1012 USE ioipsl 1013 USE dimphy 1014 USE mod_phys_lmdz_para 1015 USE iophy 1016 1017 IMPLICIT NONE 1018 1019 INCLUDE "dimensions.h" 1020 INCLUDE "temps.h" 1021 INCLUDE "clesphys.h" 1022 1023 INTEGER :: iff 1024 TYPE(ctrl_out) :: var 1025 1026 REAL zstophym 1027 CHARACTER(LEN=20) :: typeecrit 1028 1029 ! ug On récupère le type écrit de la structure: 1030 ! Assez moche, à refaire si meilleure méthode... 1031 IF (INDEX(var%type_ecrit(iff), "once") > 0) THEN 1032 typeecrit = 'once' 1033 ELSE IF(INDEX(var%type_ecrit(iff), "t_min") > 0) THEN 1034 typeecrit = 't_min(X)' 1035 ELSE IF(INDEX(var%type_ecrit(iff), "t_max") > 0) THEN 1036 typeecrit = 't_max(X)' 1037 ELSE IF(INDEX(var%type_ecrit(iff), "inst") > 0) THEN 1038 typeecrit = 'inst(X)' 1039 ELSE 1040 typeecrit = type_ecri_files(iff) 1041 ENDIF 1042 1043 1044 ! Appel a la lecture des noms et niveau d'ecriture des variables dans output.def 1045 CALL conf_physoutputs(var%name,var%flag) 1046 1047 IF (typeecrit=='inst(X)'.OR.typeecrit=='once') THEN 1048 zstophym=zoutm(iff) 1049 ELSE 1050 zstophym=zdtime 1051 ENDIF 1052 1053 IF(.NOT.clef_stations(iff)) THEN 1054 IF ( var%flag(iff)<=lev_files(iff) ) THEN 1055 CALL histdef (nid_files(iff), var%name, var%description, var%unit, & 1056 iim, jj_nb, nhorim(iff), klev, levmin(iff), & 1057 levmax(iff)-levmin(iff)+1, nvertm(iff), 32, typeecrit, & 1058 zstophym, zoutm(iff)) 1059 ENDIF 1060 ELSE 1061 IF ( var%flag(iff)<=lev_files(iff)) THEN 1062 CALL histdef (nid_files(iff), var%name, var%description, var%unit, & 1063 npstn,1,nhorim(iff), klev, levmin(iff), & 1064 levmax(iff)-levmin(iff)+1, nvertm(iff), 32, & 1065 typeecrit, zstophym,zoutm(iff)) 1066 ENDIF 1067 ENDIF 1068 END SUBROUTINE histdef3d 1932 1069 1933 1070 SUBROUTINE conf_physoutputs(nam_var,flag_var) … … 1940 1077 include 'iniprint.h' 1941 1078 1942 character(len=20) :: nam_var1943 integer, dimension(nfiles) :: flag_var1079 CHARACTER(LEN=20) :: nam_var 1080 INTEGER, DIMENSION(nfiles) :: flag_var 1944 1081 1945 1082 IF(prt_level>10) WRITE(lunout,*)'Avant getin: nam_var flag_var ',nam_var,flag_var(:) 1946 callgetin('flag_'//nam_var,flag_var)1947 callgetin('name_'//nam_var,nam_var)1083 CALL getin('flag_'//nam_var,flag_var) 1084 CALL getin('name_'//nam_var,nam_var) 1948 1085 IF(prt_level>10) WRITE(lunout,*)'Apres getin: nam_var flag_var ',nam_var,flag_var(:) 1949 1086 … … 1957 1094 IMPLICIT NONE 1958 1095 1959 character(len=20) :: str1960 character(len=10) :: type1961 integer:: ipos,il1096 CHARACTER(LEN=20) :: str 1097 CHARACTER(LEN=10) :: type 1098 INTEGER :: ipos,il 1962 1099 real :: ttt,xxx,timestep,dayseconde,dtime 1963 1100 parameter (dayseconde=86400.) … … 1966 1103 include "iniprint.h" 1967 1104 1968 ipos=scan(str,'0123456789.',. true.)1105 ipos=scan(str,'0123456789.',.TRUE.) 1969 1106 ! 1970 1107 il=len_trim(str) 1971 write(lunout,*)ipos,il1108 WRITE(lunout,*)ipos,il 1972 1109 read(str(1:ipos),*) ttt 1973 write(lunout,*)ttt1110 WRITE(lunout,*)ttt 1974 1111 type=str(ipos+1:il) 1975 1112 1976 1113 1977 if( il == ipos ) then1114 IF ( il == ipos ) then 1978 1115 type='day' 1979 1116 endif 1980 1117 1981 if( type == 'day'.or.type == 'days'.or.type == 'jours'.or.type == 'jour' ) timestep = ttt * dayseconde1982 if( type == 'mounths'.or.type == 'mth'.or.type == 'mois' ) then1983 write(lunout,*)'annee_ref,day_ref mon_len',annee_ref,day_ref,mth_len1118 IF ( type == 'day'.or.type == 'days'.or.type == 'jours'.or.type == 'jour' ) timestep = ttt * dayseconde 1119 IF ( type == 'mounths'.or.type == 'mth'.or.type == 'mois' ) then 1120 WRITE(lunout,*)'annee_ref,day_ref mon_len',annee_ref,day_ref,mth_len 1984 1121 timestep = ttt * dayseconde * mth_len 1985 1122 endif 1986 if( type == 'hours'.or.type == 'hr'.or.type == 'heurs') timestep = ttt * dayseconde / 24.1987 if( type == 'mn'.or.type == 'minutes' ) timestep = ttt * 60.1988 if( type == 's'.or.type == 'sec'.or.type == 'secondes' ) timestep = ttt1989 if( type == 'TS' ) timestep = ttt * dtime1990 1991 write(lunout,*)'type = ',type1992 write(lunout,*)'nb j/h/m = ',ttt1993 write(lunout,*)'timestep(s)=',timestep1123 IF ( type == 'hours'.or.type == 'hr'.or.type == 'heurs') timestep = ttt * dayseconde / 24. 1124 IF ( type == 'mn'.or.type == 'minutes' ) timestep = ttt * 60. 1125 IF ( type == 's'.or.type == 'sec'.or.type == 'secondes' ) timestep = ttt 1126 IF ( type == 'TS' ) timestep = ttt * dtime 1127 1128 WRITE(lunout,*)'type = ',type 1129 WRITE(lunout,*)'nb j/h/m = ',ttt 1130 WRITE(lunout,*)'timestep(s)=',timestep 1994 1131 1995 1132 END SUBROUTINE convers_timesteps -
LMDZ5/branches/testing/libf/phylmd/phys_output_var_mod.F90
r1335 r1795 14 14 REAL, SAVE, ALLOCATABLE :: snow_o(:), zfra_o(:) 15 15 !$OMP THREADPRIVATE(snow_o, zfra_o) 16 INTEGER, save, ALLOCATABLE :: itau_con(:) ! Nombre de pas ou rflag <= 116 INTEGER, SAVE, ALLOCATABLE :: itau_con(:) ! Nombre de pas ou rflag <= 1 17 17 !$OMP THREADPRIVATE(itau_con) 18 REAL, ALLOCATABLE :: bils_ec(:) ! Contribution of energy conservation 19 REAL, ALLOCATABLE :: bils_tke(:) ! Contribution of energy conservation 20 REAL, ALLOCATABLE :: bils_diss(:) ! Contribution of energy conservation 21 REAL, ALLOCATABLE :: bils_kinetic(:) ! bilan de chaleur au sol, kinetic 22 REAL, ALLOCATABLE :: bils_enthalp(:) ! bilan de chaleur au sol 23 REAL, ALLOCATABLE :: bils_latent(:) ! bilan de chaleur au sol 24 !$OMP THREADPRIVATE(bils_ec,bils_tke,bils_diss,bils_kinetic,bils_enthalp,bils_latent) 18 25 26 ! ug Plein de variables venues de phys_output_mod 27 INTEGER, PARAMETER :: nfiles = 6 28 LOGICAL, DIMENSION(nfiles), SAVE :: clef_files 29 LOGICAL, DIMENSION(nfiles), SAVE :: clef_stations 30 INTEGER, DIMENSION(nfiles), SAVE :: lev_files 31 INTEGER, DIMENSION(nfiles), SAVE :: nid_files 32 INTEGER, DIMENSION(nfiles), SAVE :: nnid_files 33 !$OMP THREADPRIVATE(clef_files, clef_stations, lev_files,nid_files,nnid_files) 34 INTEGER, DIMENSION(nfiles), SAVE :: nnhorim 35 36 INTEGER, DIMENSION(nfiles), SAVE :: nhorim, nvertm 37 INTEGER, DIMENSION(nfiles), SAVE :: nvertap, nvertbp, nvertAlt 38 REAL, DIMENSION(nfiles), SAVE :: zoutm 39 CHARACTER(LEN=20), DIMENSION(nfiles), SAVE :: type_ecri 40 !$OMP THREADPRIVATE(nnhorim, nhorim, nvertm, zoutm,type_ecri) 41 CHARACTER(LEN=20), DIMENSION(nfiles), SAVE :: type_ecri_files, phys_out_filetypes 42 !$OMP THREADPRIVATE(type_ecri_files, phys_out_filetypes) 43 44 ! swaero_diag : flag indicates if it is necessary to do calculation for some aerosol diagnostics 45 LOGICAL, SAVE :: swaero_diag=.FALSE. 46 !$OMP THREADPRIVATE(swaero_diag) 47 48 INTEGER, SAVE:: levmin(nfiles) = 1 49 INTEGER, SAVE:: levmax(nfiles) 50 !$OMP THREADPRIVATE(levmin, levmax) 51 52 TYPE ctrl_out 53 INTEGER,DIMENSION(nfiles) :: flag 54 CHARACTER(len=20) :: name 55 CHARACTER(len=150) :: description 56 CHARACTER(len=20) :: unit 57 CHARACTER(len=20),DIMENSION(nfiles) :: type_ecrit 58 END TYPE ctrl_out 19 59 CONTAINS 20 60 … … 27 67 allocate(snow_o(klon), zfra_o(klon)) 28 68 allocate(itau_con(klon)) 69 allocate (bils_ec(klon),bils_tke(klon),bils_diss(klon),bils_kinetic(klon),bils_enthalp(klon),bils_latent(klon)) 29 70 30 71 END SUBROUTINE phys_output_var_init … … 36 77 37 78 deallocate(snow_o,zfra_o,itau_con) 79 deallocate (bils_ec,bils_tke,bils_diss,bils_kinetic,bils_enthalp,bils_latent) 38 80 39 81 END SUBROUTINE phys_output_var_end -
LMDZ5/branches/testing/libf/phylmd/phys_state_var_mod.F90
r1750 r1795 63 63 !$OMP THREADPRIVATE(ratqs) 64 64 REAL, ALLOCATABLE, SAVE :: pbl_tke(:,:,:) ! turb kinetic energy 65 !$OMP THREADPRIVATE(pbl_tke) 65 REAL, ALLOCATABLE, SAVE :: coefh(:,:,:) ! Kz enthalpie 66 REAL, ALLOCATABLE, SAVE :: coefm(:,:,:) ! Kz momentum 67 !$OMP THREADPRIVATE(pbl_tke, coefh,coefm) 66 68 REAL, ALLOCATABLE, SAVE :: zmax0(:), f0(:) ! 67 69 !$OMP THREADPRIVATE(zmax0,f0) … … 359 361 !====================================================================== 360 362 SUBROUTINE phys_state_var_init(read_climoz) 361 usedimphy363 USE dimphy 362 364 USE control_mod 363 use aero_mod 364 use infotrac, ONLY : nbtr 365 USE aero_mod 366 USE infotrac, ONLY : nbtr 367 USE indice_sol_mod 365 368 IMPLICIT NONE 366 369 … … 373 376 ! climatology and the daylight climatology 374 377 375 #include "indicesol.h"376 378 ALLOCATE(rlat(klon), rlon(klon)) 377 379 ALLOCATE(pctsrf(klon,nbsrf)) … … 394 396 ALLOCATE(clwcon(klon,klev),rnebcon(klon,klev)) 395 397 ALLOCATE(ratqs(klon,klev)) 396 ALLOCATE(pbl_tke(klon,klev+1,nbsrf)) 398 ALLOCATE(pbl_tke(klon,klev+1,nbsrf+1)) 399 ALLOCATE(coefh(klon,klev+1,nbsrf+1)) 400 ALLOCATE(coefm(klon,klev+1,nbsrf+1)) 397 401 ALLOCATE(zmax0(klon), f0(klon)) 398 402 ALLOCATE(ema_work1(klon,klev), ema_work2(klon,klev)) … … 518 522 !====================================================================== 519 523 SUBROUTINE phys_state_var_end 520 use dimphy 521 use control_mod 524 USE dimphy 525 USE control_mod 526 USE indice_sol_mod 522 527 IMPLICIT NONE 523 #include "indicesol.h"524 528 525 529 deallocate(rlat, rlon, pctsrf, ftsol, falb1, falb2) … … 530 534 deallocate( u_ancien, v_ancien ) 531 535 deallocate( tr_ancien) !RomP 532 deallocate(ratqs, pbl_tke )536 deallocate(ratqs, pbl_tke,coefh,coefm) 533 537 deallocate(zmax0, f0) 534 538 deallocate(ema_work1, ema_work2) -
LMDZ5/branches/testing/libf/phylmd/physiq.F
r1750 r1795 31 31 USE fonte_neige_mod, ONLY : fonte_neige_get_vars 32 32 USE phys_output_mod 33 USE phys_output_ctrlout_mod 34 USE iophy 33 35 use open_climoz_m, only: open_climoz ! ozone climatology from a file 34 36 use regr_pr_av_m, only: regr_pr_av 35 37 use netcdf95, only: nf95_close 36 38 cIM for NMC files 37 use netcdf, only: nf90_fill_real 39 c use netcdf, only: nf90_fill_real 40 use netcdf 38 41 use mod_phys_lmdz_mpi_data, only: is_mpi_root 39 42 USE aero_mod … … 45 48 USE CHEM_REP, ONLY : Init_chem_rep_xjour 46 49 #endif 47 50 USE indice_sol_mod 48 51 49 52 !IM stations CFMIP 50 53 USE CFMIP_point_locations 51 54 IMPLICIT none 52 c======================================================================53 c 54 cAuteur(s) Z.X. Li (LMD/CNRS) date: 1993081855 c 56 cObjet: Moniteur general de la physique du modele57 cAA Modifications quant aux traceurs :58 cAA - uniformisation des parametrisations ds phytrac59 cAA - stockage des moyennes des champs necessaires60 cAA en mode traceur off-line61 c======================================================================62 cCLEFS CPP POUR LES IO63 c=====================55 !>====================================================================== 56 !! 57 !! Auteur(s) Z.X. Li (LMD/CNRS) date: 19930818 58 !! 59 !! Objet: Moniteur general de la physique du modele 60 !!AA Modifications quant aux traceurs : 61 !!AA - uniformisation des parametrisations ds phytrac 62 !!AA - stockage des moyennes des champs necessaires 63 !!AA en mode traceur off-line 64 !!====================================================================== 65 !! CLEFS CPP POUR LES IO 66 !! ===================== 64 67 #define histNMC 65 68 c#define histISCCP 66 c======================================================================67 cmodif ( P. Le Van , 12/10/98 )68 c 69 cArguments:70 c 71 cnlon----input-I-nombre de points horizontaux72 cnlev----input-I-nombre de couches verticales, doit etre egale a klev73 cdebut---input-L-variable logique indiquant le premier passage74 clafin---input-L-variable logique indiquant le dernier passage75 cjD_cur -R-jour courant a l'appel de la physique (jour julien)76 cjH_cur -R-heure courante a l'appel de la physique (jour julien)77 cpdtphys-input-R-pas d'integration pour la physique (seconde)78 cpaprs---input-R-pression pour chaque inter-couche (en Pa)79 cpplay---input-R-pression pour le mileu de chaque couche (en Pa)80 cpphi----input-R-geopotentiel de chaque couche (g z) (reference sol)81 cpphis---input-R-geopotentiel du sol82 cpresnivs-input_R_pressions approximat. des milieux couches ( en PA)83 cu-------input-R-vitesse dans la direction X (de O a E) en m/s84 cv-------input-R-vitesse Y (de S a N) en m/s85 ct-------input-R-temperature (K)86 cqx------input-R-humidite specifique (kg/kg) et d'autres traceurs87 cd_t_dyn-input-R-tendance dynamique pour "t" (K/s)88 cd_q_dyn-input-R-tendance dynamique pour "q" (kg/kg/s)89 cflxmass_w -input-R- flux de masse verticale90 cd_u-----output-R-tendance physique de "u" (m/s/s)91 cd_v-----output-R-tendance physique de "v" (m/s/s)92 cd_t-----output-R-tendance physique de "t" (K/s)93 cd_qx----output-R-tendance physique de "qx" (kg/kg/s)94 cd_ps----output-R-tendance physique de la pression au sol95 cIM96 cPVteta--output-R-vorticite potentielle a des thetas constantes97 c======================================================================69 !!====================================================================== 70 !! modif ( P. Le Van , 12/10/98 ) 71 !! 72 !! Arguments: 73 !! 74 !! nlon----input-I-nombre de points horizontaux 75 !! nlev----input-I-nombre de couches verticales, doit etre egale a klev 76 !! debut---input-L-variable logique indiquant le premier passage 77 !! lafin---input-L-variable logique indiquant le dernier passage 78 !! jD_cur -R-jour courant a l'appel de la physique (jour julien) 79 !! jH_cur -R-heure courante a l'appel de la physique (jour julien) 80 !! pdtphys-input-R-pas d'integration pour la physique (seconde) 81 !! paprs---input-R-pression pour chaque inter-couche (en Pa) 82 !! pplay---input-R-pression pour le mileu de chaque couche (en Pa) 83 !! pphi----input-R-geopotentiel de chaque couche (g z) (reference sol) 84 !! pphis---input-R-geopotentiel du sol 85 !! presnivs-input_R_pressions approximat. des milieux couches ( en PA) 86 !! u-------input-R-vitesse dans la direction X (de O a E) en m/s 87 !! v-------input-R-vitesse Y (de S a N) en m/s 88 !! t-------input-R-temperature (K) 89 !! qx------input-R-humidite specifique (kg/kg) et d'autres traceurs 90 !! d_t_dyn-input-R-tendance dynamique pour "t" (K/s) 91 !! d_q_dyn-input-R-tendance dynamique pour "q" (kg/kg/s) 92 !! flxmass_w -input-R- flux de masse verticale 93 !! d_u-----output-R-tendance physique de "u" (m/s/s) 94 !! d_v-----output-R-tendance physique de "v" (m/s/s) 95 !! d_t-----output-R-tendance physique de "t" (K/s) 96 !! d_qx----output-R-tendance physique de "qx" (kg/kg/s) 97 !! d_ps----output-R-tendance physique de la pression au sol 98 !!IM 99 !! PVteta--output-R-vorticite potentielle a des thetas constantes 100 !!====================================================================== 98 101 #include "dimensions.h" 99 102 integer jjmp1 … … 103 106 104 107 #include "regdim.h" 105 #include "indicesol.h"106 108 #include "dimsoil.h" 107 109 #include "clesphys.h" … … 218 220 REAL u(klon,klev) 219 221 REAL v(klon,klev) 220 REAL t(klon,klev),theta(klon,klev) 222 REAL t(klon,klev),theta(klon,klev),thetal(klon,klev) 223 c thetal: ligne suivante a decommenter si vous avez les fichiers MPL 20130625 224 c fth_fonctions.F90 et parkind1.F90 225 c sinon thetal=theta 226 c REAL fth_thetae,fth_thetav,fth_thetal 221 227 REAL qx(klon,klev,nqtot) 222 228 REAL flxmass_w(klon,klev) … … 642 648 REAL zw2(klon,klev+1) 643 649 REAL fraca(klon,klev+1) 644 REAL ztv(klon,klev) 650 REAL ztv(klon,klev),ztva(klon,klev) 645 651 REAL zpspsk(klon,klev) 646 REAL ztla(klon,klev) 652 REAL ztla(klon,klev),zqla(klon,klev) 647 653 REAL zthl(klon,klev) 648 654 … … 655 661 real w0(klon) ! Vitesse des thermiques au LCL 656 662 real w_conv(klon) ! Vitesse verticale de grande \'echelle au LCL 663 real tke0(klon,klev+1) ! TKE au début du pas de temps 657 664 real therm_tke_max0(klon) ! TKE dans les thermiques au LCL 658 665 real env_tke_max0(klon) ! TKE dans l'environnement au LCL … … 694 701 cAA 695 702 cAA Pour phytrac 696 cAA697 REAL coefh(klon,klev) ! coef d'echange pour phytrac, valable pour 2<=k<=klev698 REAL coefm(klon,klev) ! coef d'echange pour U, V699 703 REAL u1(klon) ! vents dans la premiere couche U 700 704 REAL v1(klon) ! vents dans la premiere couche V … … 722 726 723 727 REAL bils(klon) ! bilan de chaleur au sol 728 724 729 REAL wfbilo(klon,nbsrf) ! bilan d'eau, pour chaque 725 730 C ! type de sous-surface et pondere par la fraction … … 751 756 SAVE lmt_pas ! frequence de mise a jour 752 757 c$OMP THREADPRIVATE(lmt_pas) 753 real zmasse(klon, llm) 758 real zmasse(klon, llm),exner(klon, llm) 754 759 C (column-density of mass of air in a cell, in kg m-2) 755 760 real, parameter:: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2 … … 1058 1063 . prof2d_av = 3, prof3d_av = 4) 1059 1064 character*30 nom_fichier 1060 character* 10 varname1065 character*40 varname 1061 1066 character*40 vartitle 1062 1067 character*20 varunits … … 1121 1126 LOGICAL, SAVE :: new_aod 1122 1127 c$OMP THREADPRIVATE(new_aod) 1123 1128 c 1129 c--STRAT AEROSOL 1130 LOGICAL, SAVE :: flag_aerosol_strat 1131 c$OMP THREADPRIVATE(flag_aerosol_strat) 1132 cc-fin STRAT AEROSOL 1124 1133 c 1125 1134 c Declaration des constantes et des fonctions thermodynamiques … … 1271 1280 . iflag_cldcon,iflag_ratqs,ratqsbas,ratqshaut,tau_ratqs, 1272 1281 . ok_ade, ok_aie, ok_cdnc, aerosol_couple, 1273 . flag_aerosol, new_aod,1282 . flag_aerosol, flag_aerosol_strat, new_aod, 1274 1283 . bl95_b0, bl95_b1, 1275 1284 c nv flags pour la convection et les poches froides … … 1287 1296 pbase=0 1288 1297 cIM 180608 1289 c pmflxr=0.1290 c pmflxs=0.1291 1298 1292 1299 itau_con=0 … … 1395 1402 1396 1403 CALL phyetat0 ("startphy.nc",clesphy0,tabcntr0) 1404 IF (klon_glo==1) THEN 1405 coefh=0. ; coefm=0. ; pbl_tke=0. 1406 coefh(:,2,:)=1.e-2 ; coefm(:,2,:)=1.e-2 ; pbl_tke(:,2,:)=1.e-2 1407 PRINT*,'FH WARNING : lignes a supprimer' 1408 ENDIF 1397 1409 cIM begin 1398 1410 print*,'physiq: clwcon rnebcon ratqs',clwcon(1,1),rnebcon(1,1) … … 1593 1605 & ok_hf,ok_instan,ok_LES,ok_ade,ok_aie, 1594 1606 & read_climoz, phys_out_filestations, 1595 & new_aod, aerosol_couple 1596 & )1607 & new_aod, aerosol_couple, 1608 & flag_aerosol_strat ) 1597 1609 c$OMP END MASTER 1598 1610 c$OMP BARRIER … … 1769 1781 d1a(:,:)=0. 1770 1782 dam(:,:)=0. 1783 pmflxr=0. 1784 pmflxs=0. 1771 1785 ! RomP <<< 1772 1786 … … 1784 1798 ENDDO 1785 1799 ENDDO 1800 tke0(:,:)=pbl_tke(:,:,is_ave) 1786 1801 IF (nqtot.GE.3) THEN 1787 1802 DO iq = 3, nqtot … … 2072 2087 s albsol1, albsol2, sens, evap, 2073 2088 s zxtsol, zxfluxlat, zt2m, qsat2m, 2074 s d_t_vdf, d_q_vdf, d_u_vdf, d_v_vdf, 2089 s d_t_vdf, d_q_vdf, d_u_vdf, d_v_vdf, d_t_diss, 2075 2090 s coefh, coefm, slab_wfbils, 2076 2091 d qsol, zq2m, s_pblh, s_lcl, … … 2088 2103 !----------------------------------------------------------------------------------------- 2089 2104 ! ajout des tendances de la diffusion turbulente 2090 CALL add_phys_tend(d_u_vdf,d_v_vdf,d_t_vdf,d_q_vdf,dql0,'vdf') 2105 CALL add_phys_tend 2106 s (d_u_vdf,d_v_vdf,d_t_vdf+d_t_diss,d_q_vdf,dql0,'vdf') 2091 2107 !----------------------------------------------------------------------------------------- 2092 2108 … … 2658 2674 s ,alp_bl_conv,alp_bl_stat 2659 2675 ccc fin nrlmd le 10/04/2012 2660 s 2676 s ,zqla,ztva ) 2661 2677 2662 2678 ccc nrlmd le 10/04/2012 … … 2966 2982 cg_aero(:,:,:,:) = 0. 2967 2983 ENDIF 2984 c 2985 c--STRAT AEROSOL 2986 c--updates tausum_aero,tau_aero,piz_aero,cg_aero 2987 IF (flag_aerosol_strat) THEN 2988 PRINT *,'appel a readaerosolstrat', mth_cur 2989 CALL readaerosolstrato(debut) 2990 ENDIF 2991 c--fin STRAT AEROSOL 2968 2992 2969 2993 cIM calcul nuages par le simulateur ISCCP … … 3174 3198 $ paprs, 3175 3199 $ pplay, 3176 $ coefh ,3200 $ coefh(:,:,is_ave), 3177 3201 $ pphi, 3178 3202 $ t_seri, … … 3353 3377 e t_seri,q_seri,wo, 3354 3378 e cldfrarad, cldemirad, cldtaurad, 3355 e ok_ade, ok_aie, flag_aerosol, 3379 e ok_ade.OR.flag_aerosol_strat, ok_aie, flag_aerosol, 3380 e flag_aerosol_strat, 3356 3381 e tau_aero, piz_aero, cg_aero, 3357 3382 e cldtaupirad,new_aod, … … 3395 3420 e t_seri,q_seri,wo, 3396 3421 e cldfra, cldemi, cldtau, 3397 e ok_ade, ok_aie, flag_aerosol, 3422 e ok_ade.OR.flag_aerosol_strat, ok_aie, flag_aerosol, 3423 e flag_aerosol_strat, 3398 3424 e tau_aero, piz_aero, cg_aero, 3399 3425 e cldtaupi,new_aod, … … 3431 3457 solsw=0. 3432 3458 radsol=0. 3459 swup=0. ! MPL 27102011 pour les fichiers AMMA_profiles et AMMA_scalars 3460 swup0=0. 3461 swdn=0. 3462 swdn0=0. 3463 lwup=0. 3464 lwup0=0. 3465 lwdn=0. 3466 lwdn0=0. 3433 3467 END IF 3434 3468 … … 3695 3729 I paprs, pplay, pmfu, pmfd, 3696 3730 I pen_u, pde_u, pen_d, pde_d, 3697 I cdragh, coefh , fm_therm, entr_therm,3731 I cdragh, coefh(:,:,is_ave), fm_therm, entr_therm, 3698 3732 I u1, v1, ftsol, pctsrf, 3699 3733 I ustar, u10m, v10m, … … 3722 3756 I t,pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, 3723 3757 I fm_therm,entr_therm, 3724 I cdragh,coefh ,u1,v1,ftsol,pctsrf,3758 I cdragh,coefh(:,:,is_ave),u1,v1,ftsol,pctsrf, 3725 3759 I frac_impa, frac_nucl, 3726 3760 I pphis,airephy,dtime,itap, … … 3748 3782 c Accumuler les variables a stocker dans les fichiers histoire: 3749 3783 c 3750 c+jld ec_conser 3751 DO k = 1, klev 3752 DO i = 1, klon 3753 ZRCPD = RCPD*(1.0+RVTMP2*q_seri(i,k)) 3754 d_t_ec(i,k)=0.5/ZRCPD 3755 $ *(u(i,k)**2+v(i,k)**2-u_seri(i,k)**2-v_seri(i,k)**2) 3756 ENDDO 3757 ENDDO 3758 3759 DO k = 1, klev 3760 DO i = 1, klon 3761 t_seri(i,k)=t_seri(i,k)+d_t_ec(i,k) 3762 d_t_ec(i,k) = d_t_ec(i,k)/dtime 3763 END DO 3764 END DO 3765 c-jld ec_conser 3784 3785 !================================================================ 3786 ! Conversion of kinetic and potential energy into heat, for 3787 ! parameterisation of subgrid-scale motions 3788 !================================================================ 3789 3790 d_t_ec(:,:)=0. 3791 forall (k=1: llm) exner(:, k) = (pplay(:, k)/paprs(:,1))**RKAPPA 3792 CALL ener_conserv(klon,klev,pdtphys,u,v,t,qx(:,:,ivap), 3793 s u_seri,v_seri,t_seri,q_seri,pbl_tke(:,:,is_ave)-tke0(:,:), 3794 s zmasse,exner,d_t_ec) 3795 t_seri(:,:)=t_seri(:,:)+d_t_ec(:,:) 3796 3766 3797 cIM 3767 3798 IF (ip_ebil_phy.ge.1) THEN … … 3833 3864 END IF 3834 3865 3835 c============================================================= 3866 3836 3867 c 3837 3868 c Convertir les incrementations en tendances … … 3946 3977 cJYG/IM theta en fin de pas de temps de physique 3947 3978 theta(i,k)=t_seri(i,k)*(100000./pplay(i,k))**(RD/RCPD) 3979 c thetal: 2 lignes suivantes a decommenter si vous avez les fichiers MPL 20130625 3980 c fth_fonctions.F90 et parkind1.F90 3981 c sinon thetal=theta 3982 c thetal(i,k)=fth_thetal(pplay(i,k),t_seri(i,k),q_seri(i,k), 3983 c : ql_seri(i,k)) 3984 thetal(i,k)=theta(i,k) 3948 3985 ENDDO 3949 3986 ENDDO … … 3962 3999 CALL fonte_neige_get_vars(pctsrf, 3963 4000 . zxfqcalving, zxfqfonte, zxffonte) 4001 3964 4002 3965 4003 … … 3993 4031 endif 3994 4032 3995 3996 #include "phys_output_write.h" 4033 #include "phys_output_write_new.h" 4034 4035 4036 3997 4037 3998 4038 #ifdef histISCCP … … 4072 4112 ENDIF !if callstats 4073 4113 4074 4075 4114 IF (lafin) THEN 4076 4115 itau_phy = itau_phy + itap -
LMDZ5/branches/testing/libf/phylmd/phystokenc.F90
r1539 r1795 12 12 USE iophy 13 13 USE control_mod 14 USE indice_sol_mod 14 15 15 16 IMPLICIT NONE … … 22 23 INCLUDE "dimensions.h" 23 24 INCLUDE "tracstoke.h" 24 INCLUDE "indicesol.h"25 25 INCLUDE "iniprint.h" 26 26 !====================================================================== -
LMDZ5/branches/testing/libf/phylmd/phytrac.F90
r1750 r1795 45 45 USE tracreprobus_mod 46 46 USE control_mod 47 USE indice_sol_mod 47 48 48 49 IMPLICIT NONE … … 50 51 INCLUDE "YOMCST.h" 51 52 INCLUDE "dimensions.h" 52 INCLUDE "indicesol.h"53 53 INCLUDE "clesphys.h" 54 54 INCLUDE "temps.h" … … 203 203 INTEGER :: itau_w ! pas de temps ecriture = nstep + itau_phy 204 204 LOGICAL,PARAMETER :: ok_sync=.TRUE. 205 CHARACTER(len=20) :: chtratimestep206 205 CHARACTER(len=20),save :: chtratimestep,chtratimestep_omp 206 !$OMP THREADPRIVATE(chtratimestep) 207 207 ! 208 208 ! Nature du traceur … … 264 264 CHARACTER(len=8),DIMENSION(nbtr) :: solsym 265 265 !RomP >>> 266 INTEGER,SAVE :: iflag_lscav 267 LOGICAL,SAVE :: convscav 266 INTEGER,SAVE :: iflag_lscav_omp,iflag_lscav 267 LOGICAL,SAVE :: convscav_omp,convscav 268 268 !$OMP THREADPRIVATE(iflag_lscav,convscav) 269 269 !RomP <<< … … 309 309 IF (debutphy) THEN 310 310 !!jyg 311 chtratimestep='DefFreq' 312 CALL getin('tra_time_step',chtratimestep) 311 !$OMP MASTER 312 chtratimestep_omp='DefFreq' 313 CALL getin('tra_time_step',chtratimestep_omp) 314 !$OMP END MASTER 315 !$OMP BARRIER 316 chtratimestep=chtratimestep_omp 313 317 IF (chtratimestep .NE. 'DefFreq') THEN 314 318 call convers_timesteps(chtratimestep,pdtphys,ecrit_tra) … … 321 325 !Config Help = 322 326 ! 323 convscav=.false. 324 call getin('convscav', convscav) 327 !$OMP MASTER 328 convscav_omp=.false. 329 call getin('convscav', convscav_omp) 330 !$OMP END MASTER 331 !$OMP BARRIER 332 convscav=convscav_omp 325 333 print*,'phytrac passage dans routine conv avec lessivage', convscav 326 334 ! … … 331 339 !Config Help = 332 340 ! 333 iflag_lscav=1 334 call getin('iflag_lscav', iflag_lscav) 341 !$OMP MASTER 342 iflag_lscav_omp=1 343 call getin('iflag_lscav', iflag_lscav_omp) 344 !$OMP END MASTER 345 !$OMP BARRIER 346 iflag_lscav=iflag_lscav_omp 335 347 ! 336 348 SELECT CASE(iflag_lscav) … … 371 383 INCLUDE "ini_histrac.h" 372 384 #endif 373 END IF 385 END IF ! of IF (debutphy) 374 386 !############################################ END INITIALIZATION ####### 375 387 -
LMDZ5/branches/testing/libf/phylmd/radlwsw_m.F90
r1707 r1795 11 11 cldfra, cldemi, cldtaupd,& 12 12 ok_ade, ok_aie, flag_aerosol,& 13 flag_aerosol_strat,& 13 14 tau_aero, piz_aero, cg_aero,& 14 15 cldtaupi, new_aod, & … … 57 58 ! ok_aie---input-L- apply the Aerosol Indirect Effect or not? 58 59 ! flag_aerosol-input-I- aerosol flag from 0 to 6 60 ! flag_aerosol_strat-input-I- use stratospheric aerosols flag (T/F) 59 61 ! tau_ae, piz_ae, cg_ae-input-R- aerosol optical properties (calculated in aeropt.F) 60 62 ! cldtaupi-input-R- epaisseur optique des nuages dans le visible … … 121 123 LOGICAL, INTENT(in) :: ok_ade, ok_aie ! switches whether to use aerosol direct (indirect) effects or not 122 124 INTEGER, INTENT(in) :: flag_aerosol ! takes value 0 (no aerosol) or 1 to 6 (aerosols) 125 LOGICAL, INTENT(in) :: flag_aerosol_strat ! use stratospheric aerosols 123 126 REAL, INTENT(in) :: cldfra(KLON,KLEV), cldemi(KLON,KLEV), cldtaupd(KLON,KLEV) 124 127 REAL, INTENT(in) :: tau_aero(KLON,KLEV,9,2) ! aerosol optical properties (see aeropt.F) … … 360 363 ztopswadaero,zsolswadaero,& 361 364 ztopswaiaero,zsolswaiaero,& 362 ok_ade, ok_aie , flag_aerosol)365 ok_ade, ok_aie) 363 366 364 367 ELSE ! new_aod=T … … 379 382 zsolsw_aero,zsolsw0_aero,& 380 383 ztopswcf_aero,zsolswcf_aero, & 381 ok_ade, ok_aie, flag_aerosol )384 ok_ade, ok_aie, flag_aerosol,flag_aerosol_strat) 382 385 ENDIF 383 386 -
LMDZ5/branches/testing/libf/phylmd/read_pstoke.F
r1403 r1795 21 21 USE dimphy 22 22 USE control_mod 23 USE indice_sol_mod 23 24 24 25 IMPLICIT NONE … … 34 35 #include "description.h" 35 36 #include "serre.h" 36 #include "indicesol.h"37 37 cccc#include "dimphy.h" 38 38 -
LMDZ5/branches/testing/libf/phylmd/read_pstoke0.F
r1403 r1795 17 17 C****************************************************************************** 18 18 19 usenetcdf19 USE netcdf 20 20 USE dimphy 21 21 USE control_mod 22 USE indice_sol_mod 22 23 23 24 IMPLICIT NONE … … 33 34 #include "description.h" 34 35 #include "serre.h" 35 #include "indicesol.h"36 36 cccc#include "dimphy.h" 37 37 -
LMDZ5/branches/testing/libf/phylmd/screenc.F90
r793 r1795 22 22 ! klon----input-I- dimension de la grille physique (= nb_pts_latitude X nb_pts_longitude) 23 23 ! knon----input-I- nombre de points pour un type de surface 24 ! nsrf----input-I- indice pour le type de surface; voir indice sol.h24 ! nsrf----input-I- indice pour le type de surface; voir indice_sol_mod.F90 25 25 ! zxli----input-L- TRUE si calcul des cdrags selon Laurent Li 26 26 ! speed---input-R- module du vent au 1er niveau du modele -
LMDZ5/branches/testing/libf/phylmd/screenp.F90
r1107 r1795 22 22 ! klon----input-I- dimension de la grille physique (= nb_pts_latitude X nb_pts_longitude) 23 23 ! knon----input-I- nombre de points pour un type de surface 24 ! nsrf----input-I- indice pour le type de surface; voir indice sol.h24 ! nsrf----input-I- indice pour le type de surface; voir indice_sol_mod.F90 25 25 ! speed---input-R- module du vent au 1er niveau du modele 26 26 ! tair----input-R- temperature de l'air au 1er niveau du modele -
LMDZ5/branches/testing/libf/phylmd/soil.F90
r1664 r1795 7 7 USE dimphy 8 8 USE mod_phys_lmdz_para 9 USE indice_sol_mod 10 9 11 IMPLICIT NONE 10 12 … … 52 54 INCLUDE "YOMCST.h" 53 55 INCLUDE "dimsoil.h" 54 INCLUDE "indicesol.h"55 56 INCLUDE "comsoil.h" 56 57 INCLUDE "iniprint.h" -
LMDZ5/branches/testing/libf/phylmd/stdlevvar.F90
r793 r1795 23 23 ! klon----input-I- dimension de la grille physique (= nb_pts_latitude X nb_pts_longitude) 24 24 ! knon----input-I- nombre de points pour un type de surface 25 ! nsrf----input-I- indice pour le type de surface; voir indice sol.h25 ! nsrf----input-I- indice pour le type de surface; voir indice_sol_mod.F90 26 26 ! zxli----input-L- TRUE si calcul des cdrags selon Laurent Li 27 27 ! u1------input-R- vent zonal au 1er niveau du modele -
LMDZ5/branches/testing/libf/phylmd/stratocu_if.F90
r878 r1795 1 1 SUBROUTINE stratocu_if(klon,klev,pctsrf,paprs, pplay,t & 2 2 ,seuil_inversion,weak_inversion,dthmin) 3 implicit none 3 4 USE indice_sol_mod 5 6 IMPLICIT NONE 4 7 5 8 !====================================================================== … … 39 42 REAL dthmin(klon), zdthdp 40 43 41 INCLUDE "indicesol.h"42 44 INCLUDE "YOMCST.h" 43 45 -
LMDZ5/branches/testing/libf/phylmd/surf_land_bucket_mod.F90
r1750 r1795 27 27 USE mod_grid_phy_lmdz 28 28 USE mod_phys_lmdz_para 29 USE indice_sol_mod 29 30 !**************************************************************************************** 30 31 ! Bucket calculations for surface. 31 32 ! 32 33 INCLUDE "clesphys.h" 33 INCLUDE "indicesol.h"34 34 INCLUDE "dimsoil.h" 35 35 INCLUDE "YOMCST.h" -
LMDZ5/branches/testing/libf/phylmd/surf_land_mod.F90
r1146 r1795 31 31 USE surf_land_bucket_mod 32 32 USE calcul_fluxs_mod 33 USE indice_sol_mod 33 34 34 INCLUDE "indicesol.h"35 35 INCLUDE "dimsoil.h" 36 36 INCLUDE "YOMCST.h" -
LMDZ5/branches/testing/libf/phylmd/surf_land_orchidee_mod.F90
r1454 r1795 44 44 USE mod_synchro_omp 45 45 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl 46 USE indice_sol_mod 46 47 47 48 ! … … 97 98 ! qsurf air moisture at surface 98 99 ! 99 INCLUDE "indicesol.h"100 100 INCLUDE "temps.h" 101 101 INCLUDE "YOMCST.h" … … 551 551 USE mod_grid_phy_lmdz 552 552 USE mod_surf_para 553 INCLUDE "indicesol.h"553 USE indice_sol_mod 554 554 555 555 #ifdef CPP_MPI -
LMDZ5/branches/testing/libf/phylmd/surf_land_orchidee_noopenmp_mod.F90
r1548 r1795 97 97 ! 98 98 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, fco2_land_inst, fco2_lu_inst 99 USE indice_sol_mod 99 100 IMPLICIT NONE 100 101 101 INCLUDE "indicesol.h"102 102 INCLUDE "temps.h" 103 103 INCLUDE "YOMCST.h" … … 634 634 SUBROUTINE Init_neighbours(knon,neighbours,ktindex,pctsrf) 635 635 636 INCLUDE "indicesol.h" 636 USE indice_sol_mod 637 637 638 INCLUDE "dimensions.h" 638 639 #ifdef CPP_MPI -
LMDZ5/branches/testing/libf/phylmd/surf_landice_mod.F90
r1403 r1795 25 25 USE calcul_fluxs_mod 26 26 USE phys_output_var_mod 27 28 INCLUDE "indicesol.h" 27 USE indice_sol_mod 28 29 ! INCLUDE "indicesol.h" 29 30 INCLUDE "dimsoil.h" 30 31 INCLUDE "YOMCST.h" -
LMDZ5/branches/testing/libf/phylmd/surf_ocean_mod.F90
r1403 r1795 25 25 USE ocean_slab_mod, ONLY : ocean_slab_noice 26 26 USE ocean_cpl_mod, ONLY : ocean_cpl_noice 27 USE indice_sol_mod 27 28 ! 28 29 ! This subroutine will make a call to ocean_XXX_noice according to the ocean mode (force, 29 30 ! slab or couple). The calculations of albedo and rugosity for the ocean surface are 30 31 ! done in here because they are identical for the different modes of ocean. 31 ! 32 INCLUDE "indicesol.h" 32 33 33 34 INCLUDE "YOMCST.h" 34 35 -
LMDZ5/branches/testing/libf/phylmd/surf_seaice_mod.F90
r1072 r1795 25 25 USE ocean_forced_mod, ONLY : ocean_forced_ice 26 26 USE ocean_cpl_mod, ONLY : ocean_cpl_ice 27 USE indice_sol_mod 27 28 28 29 ! … … 31 32 ! in here because it is the same calculation for the different modes of ocean. 32 33 ! 33 INCLUDE "indicesol.h"34 34 INCLUDE "dimsoil.h" 35 35 -
LMDZ5/branches/testing/libf/phylmd/sw_aeroAR4.F90
r1669 r1795 18 18 PSOLSWAERO,PSOLSW0AERO,& 19 19 PTOPSWCFAERO,PSOLSWCFAERO,& 20 ok_ade, ok_aie, flag_aerosol )20 ok_ade, ok_aie, flag_aerosol, flag_aerosol_strat ) 21 21 22 22 USE dimphy … … 138 138 139 139 LOGICAL ok_ade, ok_aie ! use aerosol forcings or not? 140 LOGICAL flag_aerosol_strat ! use stratospehric aerosols 140 141 INTEGER flag_aerosol ! global flag for aerosol 0 (no aerosol) or 1-5 (aerosols) 141 142 REAL(KIND=8) tauaero(kdlon,kflev,9,2) ! aerosol optical properties … … 307 308 ENDIF ! swaero_diag .or. .not. AEROSOLFEEDBACK_ACTIVE 308 309 309 IF (flag_aerosol .GT. 0 ) THEN310 IF (flag_aerosol .GT. 0 .OR. flag_aerosol_strat) THEN 310 311 311 312 IF (ok_ade.and.swaero_diag .or. .not. ok_ade) THEN … … 498 499 ENDIF ! ok_aie 499 500 500 ENDIF !--if flag_aerosol GT 0 501 ENDIF !--if flag_aerosol GT 0 OR flag_aerosol_strat 501 502 502 503 itapsw = 0 … … 504 505 itapsw = itapsw + 1 505 506 506 IF ( AEROSOLFEEDBACK_ACTIVE .AND. flag_aerosol .GT. 0) THEN507 IF ( AEROSOLFEEDBACK_ACTIVE .AND. (flag_aerosol .GT. 0 .OR. flag_aerosol_strat) ) THEN 507 508 IF ( ok_ade .and. ok_aie ) THEN 508 509 ZFSUP(:,:) = ZFSUP_AERO(:,:,4) -
LMDZ5/branches/testing/libf/phylmd/thermcell_main.F90
r1750 r1795 19 19 & ,alp_bl_conv,alp_bl_stat & 20 20 !!! fin nrlmd le 10/04/2012 21 & 21 & ,ztva ) 22 22 23 23 USE dimphy 24 24 USE ioipsl 25 25 USE comgeomphy , ONLY:rlond,rlatd 26 USE indice_sol_mod 26 27 IMPLICIT NONE 27 28 … … 67 68 #include "iniprint.h" 68 69 #include "thermcell.h" 69 !!! nrlmd le 10/04/201270 #include "indicesol.h"71 !!! fin nrlmd le 10/04/201272 70 73 71 ! arguments: -
LMDZ5/branches/testing/libf/phylmd/tracinca_mod.F90
r1403 r1795 46 46 USE comgeomphy 47 47 USE control_mod 48 USE indice_sol_mod 48 49 49 50 50 51 IMPLICIT NONE 51 52 52 INCLUDE "indicesol.h"53 53 INCLUDE "dimensions.h" 54 54 INCLUDE "paramet.h" -
LMDZ5/branches/testing/libf/phylmd/traclmdz_mod.F90
r1750 r1795 95 95 USE mod_grid_phy_lmdz 96 96 USE mod_phys_lmdz_para 97 98 INCLUDE "indicesol.h" 97 USE indice_sol_mod 98 99 99 INCLUDE "iniprint.h" 100 100 ! Input variables … … 346 346 USE o3_chem_m, ONLY: o3_chem 347 347 USE carbon_cycle_mod, ONLY : carbon_cycle, carbon_cycle_tr, carbon_cycle_cpl 348 USE indice_sol_mod 349 348 350 INCLUDE "YOMCST.h" 349 INCLUDE "indicesol.h"350 351 351 352 !==========================================================================
Note: See TracChangeset
for help on using the changeset viewer.