Changeset 1279 for LMDZ4/trunk/libf/dyn3d
- Timestamp:
- Dec 10, 2009, 10:02:56 AM (15 years ago)
- Location:
- LMDZ4/trunk
- Files:
-
- 6 deleted
- 41 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/trunk
- Property svn:mergeinfo changed
/LMDZ4/branches/LMDZ4-dev merged: 1150-1162,1164-1193,1195-1231,1234-1235,1237-1240,1242-1274,1276
- Property svn:mergeinfo changed
-
LMDZ4/trunk/libf/dyn3d/abort_gcm.F
r1147 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 c … … 8 8 #ifdef CPP_IOIPSL 9 9 USE IOIPSL 10 #else 11 ! if not using IOIPSL, we still need to use (a local version of) getin_dump 12 USE ioipsl_getincom 10 13 #endif 11 14 #include "iniprint.h" -
LMDZ4/trunk/libf/dyn3d/advtrac.F
r1146 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 c … … 30 30 #include "ener.h" 31 31 #include "description.h" 32 #include "iniprint.h" 32 33 33 34 c------------------------------------------------------------------- … … 74 75 DATA dum/.true./ 75 76 77 integer,save :: countcfl=0 78 real cflx(ip1jmp1,llm) 79 real cfly(ip1jm,llm) 80 real cflz(ip1jmp1,llm) 81 real, save :: cflxmax(llm),cflymax(llm),cflzmax(llm) 76 82 77 83 IF(iadvtr.EQ.0) THEN … … 139 145 ENDDO 140 146 147 148 c------------------------------------------------------------------- 149 ! Calcul des criteres CFL en X, Y et Z 150 c------------------------------------------------------------------- 151 152 if (countcfl == 0. ) then 153 cflxmax(:)=0. 154 cflymax(:)=0. 155 cflzmax(:)=0. 156 endif 157 158 countcfl=countcfl+iapp_tracvl 159 cflx(:,:)=0. 160 cfly(:,:)=0. 161 cflz(:,:)=0. 162 do l=1,llm 163 do ij=iip2,ip1jm-1 164 if (pbarug(ij,l)>=0.) then 165 cflx(ij,l)=pbarug(ij,l)*dtvr/masse(ij,l) 166 else 167 cflx(ij,l)=-pbarug(ij,l)*dtvr/masse(ij+1,l) 168 endif 169 enddo 170 enddo 171 do l=1,llm 172 do ij=iip2,ip1jm-1,iip1 173 cflx(ij+iip1,l)=cflx(ij,l) 174 enddo 175 enddo 176 177 do l=1,llm 178 do ij=1,ip1jm 179 if (pbarvg(ij,l)>=0.) then 180 cfly(ij,l)=pbarvg(ij,l)*dtvr/masse(ij,l) 181 else 182 cfly(ij,l)=-pbarvg(ij,l)*dtvr/masse(ij+iip1,l) 183 endif 184 enddo 185 enddo 186 187 do l=2,llm 188 do ij=1,ip1jm 189 if (wg(ij,l)>=0.) then 190 cflz(ij,l)=wg(ij,l)*dtvr/masse(ij,l) 191 else 192 cflz(ij,l)=-wg(ij,l)*dtvr/masse(ij,l-1) 193 endif 194 enddo 195 enddo 196 197 do l=1,llm 198 cflxmax(l)=max(cflxmax(l),maxval(cflx(:,l))) 199 cflymax(l)=max(cflymax(l),maxval(cfly(:,l))) 200 cflzmax(l)=max(cflzmax(l),maxval(cflz(:,l))) 201 enddo 202 203 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 204 ! Par defaut, on sort le diagnostic des CFL tous les jours. 205 ! Si on veut le sortir a chaque pas d'advection en cas de plantage 206 ! if (countcfl==iapp_tracvl) then 207 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 208 if (countcfl==day_step) then 209 do l=1,llm 210 write(lunout,*) 'L, CFLmax ' 211 s ,l,maxval(cflx(:,l)),maxval(cfly(:,l)),maxval(cflz(:,l)) 212 enddo 213 countcfl=0 214 endif 215 141 216 c------------------------------------------------------------------- 142 217 c Advection proprement dite (Modification Le Croller (07/2001) -
LMDZ4/trunk/libf/dyn3d/bilan_dyn.F
r693 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 SUBROUTINE bilan_dyn (ntrac,dt_app,dt_cum, … … 10 10 c vQ..A=Cp T + L * ... 11 11 12 #ifdef CPP_IOIPSL 12 13 USE IOIPSL 14 #endif 13 15 14 16 IMPLICIT NONE -
LMDZ4/trunk/libf/dyn3d/caladvtrac.F
r1146 r1279 76 76 ENDDO 77 77 ENDDO 78 79 CALL qminimum( q, 2, finmasse ) 78 79 if (planet_type.eq."earth") then 80 ! Earth-specific treatment of first 2 tracers (water) 81 CALL qminimum( q, 2, finmasse ) 82 endif 80 83 81 84 CALL SCOPY ( ip1jmp1*llm, masse, 1, finmasse, 1 ) -
LMDZ4/trunk/libf/dyn3d/calfis.F
r1146 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 C 5 5 C 6 6 SUBROUTINE calfis(lafin, 7 $ rdayvrai, 8 $ heure, 7 $ jD_cur, jH_cur, 9 8 $ pucov, 10 9 $ pvcov, … … 102 101 c ----------- 103 102 LOGICAL lafin 104 REAL heure 103 105 104 106 105 REAL pvcov(iip1,jjm,llm) … … 170 169 DATA firstcal/.true./ 171 170 SAVE firstcal,debut 172 REAL rdayvrai 171 ! REAL rdayvrai 172 REAL, intent(in):: jD_cur, jH_cur 173 173 c 174 174 c----------------------------------------------------------------------- … … 177 177 c -------------------- 178 178 c 179 180 IF (ngridmx.NE.2+(jjm-1)*iim) THEN 179 c 180 IF ( firstcal ) THEN 181 debut = .TRUE. 182 IF (ngridmx.NE.2+(jjm-1)*iim) THEN 181 183 PRINT*,'STOP dans calfis' 182 184 PRINT*,'La dimension ngridmx doit etre egale a 2 + (jjm-1)*iim' … … 184 186 PRINT*,ngridmx,jjm,iim 185 187 STOP 186 ENDIF 187 188 c----------------------------------------------------------------------- 189 c latitude, longitude et aires des mailles pour la physique: 190 c ---------------------------------------------------------- 191 192 c 193 IF ( firstcal ) THEN 194 debut = .TRUE. 188 ENDIF 195 189 ELSE 196 197 ENDIF 190 debut = .FALSE. 191 ENDIF ! of IF (firstcal) 198 192 199 193 c … … 290 284 291 285 c convergence dynamique pour les traceurs "EAU" 292 293 DO iq=1,2 286 ! Earth-specific treatment of first 2 tracers (water) 287 if (planet_type=="earth") then 288 DO iq=1,2 294 289 DO l=1,llm 295 290 pcvgq(1,l,iq)= pdq(1,1,l,iq) / pmasse(1,1,l) … … 303 298 pcvgq(ig0,l,iq)= pdq(1,jjp1,l,iq) / pmasse(1,jjp1,l) 304 299 ENDDO 305 ENDDO 300 ENDDO 301 endif ! of if (planet_type=="earth") 306 302 307 303 … … 428 424 ENDDO 429 425 c 426 if (planet_type=="earth") then 427 #ifdef CPP_EARTH 430 428 cIM calcul PV a teta=350, 380, 405K 431 429 CALL PVtheta(ngridmx,llm,pucov,pvcov,pteta, 432 430 $ ztfi,zplay,zplev, 433 431 $ ntetaSTD,rtetaSTD,PVteta) 432 #endif 433 endif 434 434 c 435 435 c On change de grille, dynamique vers physiq, pour le flux de masse verticale … … 441 441 442 442 443 if (planet_type=="earth") then 444 #ifdef CPP_EARTH 443 445 CALL physiq (ngridmx, 444 446 . llm, 445 447 . debut, 446 448 . lafin, 447 . rdayvrai,448 . heure,449 . jD_cur, 450 . jH_cur, 449 451 . dtphys, 450 452 . zplev, … … 467 469 . pducov, 468 470 . PVteta) 471 #endif 472 endif !of if (planet_type=="earth") 469 473 470 474 500 CONTINUE … … 502 506 c 62. humidite specifique 503 507 c --------------------- 504 505 DO iq=1,nqtot506 DO l=1,llm507 DO i=1,iip1508 pdqfi(i,1,l,iq) = zdqfi(1,l,iq)509 pdqfi(i,jjp1,l,iq) = zdqfi(ngridmx,l,iq)510 ENDDO511 DO j=2,jjm512 ig0=1+(j-2)*iim513 DO i=1,iim514 pdqfi(i,j,l,iq) = zdqfi(ig0+i,l,iq)515 ENDDO516 pdqfi(iip1,j,l,iq) = pdqfi(1,j,l,iq)517 ENDDO518 ENDDO519 ENDDO508 ! Ehouarn: removed this useless bit: was overwritten at step 63 anyways 509 ! DO iq=1,nqtot 510 ! DO l=1,llm 511 ! DO i=1,iip1 512 ! pdqfi(i,1,l,iq) = zdqfi(1,l,iq) 513 ! pdqfi(i,jjp1,l,iq) = zdqfi(ngridmx,l,iq) 514 ! ENDDO 515 ! DO j=2,jjm 516 ! ig0=1+(j-2)*iim 517 ! DO i=1,iim 518 ! pdqfi(i,j,l,iq) = zdqfi(ig0+i,l,iq) 519 ! ENDDO 520 ! pdqfi(iip1,j,l,iq) = pdqfi(1,j,l,iq) 521 ! ENDDO 522 ! ENDDO 523 ! ENDDO 520 524 521 525 c 63. traceurs 522 526 c ------------ 523 527 C initialisation des tendances 524 pdqfi =0.528 pdqfi(:,:,:,:)=0. 525 529 C 526 530 DO iq=1,nqtot -
LMDZ4/trunk/libf/dyn3d/coefpoly.F
r524 r1279 19 19 c On en revient a resoudre un systeme de 4 equat.a 4 inconnues a0,a1,a2,a3 20 20 21 REAL *8Xf1, Xf2,Xprim1,Xprim2, xtild1,xtild2, xi22 REAL *8Xfout, Xprim23 REAL *8a1,a2,a3,a0, xtil1car, xtil2car,derr,x1x2car21 REAL(KIND=8) Xf1, Xf2,Xprim1,Xprim2, xtild1,xtild2, xi 22 REAL(KIND=8) Xfout, Xprim 23 REAL(KIND=8) a1,a2,a3,a0, xtil1car, xtil2car,derr,x1x2car 24 24 25 25 xtil1car = xtild1 * xtild1 -
LMDZ4/trunk/libf/dyn3d/comconst.h
r1107 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 !----------------------------------------------------------------------- … … 7 7 COMMON/comconst/im,jm,lllm,imp1,jmp1,lllmm1,lllmp1,lcl, & 8 8 & dtvr,daysec, & 9 & pi,dtphys,dtdiss,rad,r,cpp,kappa,cotot,unsim,g,omeg 9 & pi,dtphys,dtdiss,rad,r,cpp,kappa,cotot,unsim,g,omeg & 10 & ,dissip_factz,dissip_deltaz,dissip_zref & 11 & ,iflag_top_bound,tau_top_bound 12 10 13 11 14 INTEGER im,jm,lllm,imp1,jmp1,lllmm1,lllmp1,lcl … … 13 16 REAL pi,dtphys,dtdiss,rad,r,cpp,kappa 14 17 REAL cotot,unsim,g,omeg 18 REAL dissip_factz,dissip_deltaz,dissip_zref 19 INTEGER iflag_top_bound 20 REAL tau_top_bound 21 15 22 16 23 !----------------------------------------------------------------------- -
LMDZ4/trunk/libf/dyn3d/comvert.h
r524 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 c-----------------------------------------------------------------------5 cINCLUDE 'comvert.h'4 !----------------------------------------------------------------------- 5 ! INCLUDE 'comvert.h' 6 6 7 COMMON/comvert/ap(llm+1),bp(llm+1),presnivs(llm),dpres(llm) ,8 ,pa,preff,nivsigs(llm),nivsig(llm+1)7 COMMON/comvert/ap(llm+1),bp(llm+1),presnivs(llm),dpres(llm), & 8 & pa,preff,nivsigs(llm),nivsig(llm+1) 9 9 10 10 REAL ap,bp,presnivs,dpres,pa,preff,nivsigs,nivsig 11 11 12 c-----------------------------------------------------------------------12 !----------------------------------------------------------------------- -
LMDZ4/trunk/libf/dyn3d/conf_gcm.F
r1146 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 c … … 38 38 #include "serre.h" 39 39 #include "comdissnew.h" 40 #include "temps.h" 41 #include "comconst.h" 40 42 41 43 ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique … … 111 113 CALL getin('planet_type',planet_type) 112 114 115 !Config Key = calend 116 !Config Desc = type de calendrier utilise 117 !Config Def = earth_360d 118 !Config Help = valeur possible: earth_360d, earth_365d, earth_366d 119 !Config 120 calend = 'earth_360d' 121 CALL getin('calend', calend) 122 113 123 !Config Key = dayref 114 124 !Config Desc = Jour de l'etat initial … … 267 277 tetatemp = 7200. 268 278 CALL getin('tetatemp',tetatemp ) 279 280 ! Parametres controlant la variation sur la verticale des constantes de 281 ! dissipation. 282 ! Pour le moment actifs uniquement dans la version a 39 niveaux 283 ! avec ok_strato=y 284 285 dissip_factz=4. 286 dissip_deltaz=10. 287 dissip_zref=30. 288 CALL getin('dissip_factz',dissip_factz ) 289 CALL getin('dissip_deltaz',dissip_deltaz ) 290 CALL getin('dissip_zref',dissip_zref ) 291 292 iflag_top_bound=1 293 tau_top_bound=1.e-5 294 CALL getin('iflag_top_bound',iflag_top_bound) 295 CALL getin('tau_top_bound',tau_top_bound) 269 296 270 297 !Config Key = coefdis … … 558 585 write(lunout,*)' Configuration des parametres du gcm: ' 559 586 write(lunout,*)' planet_type = ', planet_type 587 write(lunout,*)' calend = ', calend 560 588 write(lunout,*)' dayref = ', dayref 561 589 write(lunout,*)' anneeref = ', anneeref … … 744 772 write(lunout,*)' Configuration des parametres du gcm: ' 745 773 write(lunout,*)' planet_type = ', planet_type 774 write(lunout,*)' calend = ', calend 746 775 write(lunout,*)' dayref = ', dayref 747 776 write(lunout,*)' anneeref = ', anneeref -
LMDZ4/trunk/libf/dyn3d/create_etat0_limit.F
r1146 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 PROGRAM create_etat0_limit 5 #ifdef CPP_EARTH 6 ! This prog. is designed to work for Earth 5 7 USE dimphy 6 8 USE comgeomphy 7 9 USE infotrac 10 #ifdef CPP_IOIPSL 11 use ioipsl, only: ioconf_calendar 12 #endif 13 IMPLICIT NONE 8 14 c 9 15 c … … 41 47 END IF 42 48 43 CALL Init_Phys_lmdz(iim,jjp1,llm,1,(jjm-1)*iim+2) 49 CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/)) 50 PRINT *,'---> klon=',klon 44 51 call InitComgeomphy 52 53 #ifdef CPP_IOIPSL 54 call ioconf_calendar('360d') 55 #endif 45 56 46 57 WRITE(6,*) ' ********************* ' … … 59 70 1 FORMAT(//) 60 71 72 #endif 73 ! of #ifdef CPP_EARTH 61 74 STOP 62 75 END -
LMDZ4/trunk/libf/dyn3d/diagedyn.F
r1146 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 … … 315 315 C 316 316 #else 317 write(lunout,*) ,'diagedyn: Needs Earth physics to function'317 write(lunout,*)'diagedyn: Needs Earth physics to function' 318 318 #endif 319 319 ! #endif of #ifdef CPP_EARTH -
LMDZ4/trunk/libf/dyn3d/disvert.F
r999 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 SUBROUTINE disvert(pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig) … … 36 36 c 37 37 INTEGER l 38 REAL snorm 38 REAL snorm,dsigmin 39 39 REAL alpha,beta,gama,delta,deltaz,h 40 40 INTEGER np,ierr … … 96 96 WRITE(LUNOUT,*)'WARNING!!! Ancienne discretisation verticale' 97 97 98 if (ok_strato) then 99 if (llm==39) then 100 dsigmin=0.3 101 else if (llm==50) then 102 dsigmin=1. 103 else 104 WRITE(LUNOUT,*) 'ATTENTION discretisation z a ajuster' 105 dsigmin=1. 106 endif 107 WRITE(LUNOUT,*) 'Discretisation verticale DSIGMIN=',dsigmin 108 endif 109 98 110 h=7. 99 111 snorm = 0. … … 102 114 103 115 IF (ok_strato) THEN 104 dsig(l) =( 1.0+ 7.0 * SIN(x)**2)116 dsig(l) =(dsigmin + 7.0 * SIN(x)**2) 105 117 & *(0.5*(1.-tanh(1.*(x-asin(1.))/asin(1.))))**2 106 118 ELSE … … 149 161 c 150 162 ENDDO 163 164 bp(1)=1. 165 ap(1)=0. 166 151 167 ap(llmp1) = pa * ( sig(llmp1) - bp(llmp1) ) 152 168 -
LMDZ4/trunk/libf/dyn3d/dump2d.F
r524 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 SUBROUTINE dump2d(im,jm,z,nom_z) … … 6 6 INTEGER im,jm 7 7 REAL z(im,jm) 8 CHARACTER *80nom_z8 CHARACTER (len=*) :: nom_z 9 9 10 10 INTEGER i,j,imin,illm,jmin,jllm 11 11 REAL zmin,zllm 12 12 13 PRINT*,nom_z13 WRITE(*,*) "dump2d: ",trim(nom_z) 14 14 15 15 zmin=z(1,1) … … 39 39 40 40 IF(zllm.GT.zmin) THEN 41 DO j=1,jm42 WRITE(*,'(72i1)') (NINT(10.*(z(i,j)-zmin)/(zllm-zmin)),i=1,im)43 ENDDO41 DO j=1,jm 42 WRITE(*,'(600i1)') (NINT(10.*(z(i,j)-zmin)/(zllm-zmin)),i=1,im) 43 ENDDO 44 44 ENDIF 45 45 RETURN -
LMDZ4/trunk/libf/dyn3d/dynredem.F
r1146 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 c 5 5 SUBROUTINE dynredem0(fichnom,iday_end,phis) 6 #ifdef CPP_IOIPSL 6 7 USE IOIPSL 8 #endif 7 9 USE infotrac 8 10 IMPLICIT NONE … … 55 57 56 58 c----------------------------------------------------------------------- 57 modname='dynredem' 58 59 modname='dynredem0' 60 61 #ifdef CPP_IOIPSL 59 62 call ymds2ju(annee_ref, 1, iday_end, 0.0, zjulian) 60 63 call ju2ymds(zjulian, yyears0, mmois0, jjour0, hours) 61 64 #else 65 ! set yyears0, mmois0, jjour0 to 0,1,1 (hours is not used) 66 yyears0=0 67 mmois0=1 68 jjour0=1 69 #endif 62 70 63 71 DO l=1,length -
LMDZ4/trunk/libf/dyn3d/etat0_netcdf.F
r1146 r1279 14 14 USE phys_state_var_mod 15 15 USE filtreg_mod 16 use regr_lat_time_climoz_m, only: regr_lat_time_climoz 17 use conf_phys_m, only: conf_phys 16 18 #endif 17 19 !#endif of #ifdef CPP_EARTH 20 use netcdf, only: nf90_open, NF90_NOWRITE, nf90_close 18 21 ! 19 22 IMPLICIT NONE 20 23 ! 21 #include "netcdf.inc"22 24 #include "dimensions.h" 23 25 #include "paramet.h" … … 49 51 REAL :: vvent(iip1, jjm, llm) 50 52 REAL :: t3d(iip1, jjp1, llm), tpot(iip1, jjp1, llm) 51 REAL, ALLOCATABLE, DIMENSION(:,:,:,:) :: q3d52 53 REAL :: qsat(iip1, jjp1, llm) 54 REAL,ALLOCATABLE :: q3d(:, :, :,:) 53 55 REAL :: tsol(klon), qsol(klon), sn(klon) 54 REAL :: tsolsrf(klon,nbsrf), qsolsrf(klon,nbsrf),snsrf(klon,nbsrf) 56 !! REAL :: tsolsrf(klon,nbsrf) 57 real qsolsrf(klon,nbsrf),snsrf(klon,nbsrf) 55 58 REAL :: albe(klon,nbsrf), evap(klon,nbsrf) 56 59 REAL :: alblw(klon,nbsrf) … … 72 75 ! 73 76 74 CHARACTER *80:: varname77 CHARACTER(len=80) :: varname 75 78 ! 76 79 INTEGER :: i,j, ig, l, ji,ii1,ii2 … … 102 105 REAL :: w(ip1jmp1,llm) 103 106 REAL ::phystep 104 REAL :: rugsrel(iip1*jjp1)107 CC REAL :: rugsrel(iip1*jjp1) 105 108 REAL :: fder(klon) 106 real zrel(iip1*jjp1),chmin,chmax107 108 CHARACTER*80:: visu_file109 !! real zrel(iip1*jjp1),chmin,chmax 110 111 !! CHARACTER(len=80) :: visu_file 109 112 INTEGER :: visuid 110 113 … … 126 129 logical :: ok_journe, ok_mensuel, ok_instan, ok_hf 127 130 logical :: ok_LES 128 LOGICAL :: ok_ade, ok_aie, aerosol_couple 131 LOGICAL :: ok_ade, ok_aie, aerosol_couple, new_aod 132 INTEGER :: flag_aerosol 129 133 REAL :: bl95_b0, bl95_b1 130 134 real :: fact_cldcon, facttemps,ratqsbas,ratqshaut 135 real :: tau_ratqs 131 136 integer :: iflag_cldcon 132 137 integer :: iflag_ratqs … … 140 145 real :: seuil_inversion 141 146 147 integer read_climoz ! read ozone climatology 148 C Allowed values are 0, 1 and 2 149 C 0: do not read an ozone climatology 150 C 1: read a single ozone climatology that will be used day and night 151 C 2: read two ozone climatologies, the average day and night 152 C climatology and the daylight climatology 153 142 154 ! 143 155 ! Constantes … … 162 174 ! CALL defrun_new(99,.TRUE.,clesphy0) 163 175 CALL conf_gcm( 99, .TRUE. , clesphy0 ) 164 call conf_phys(ok_journe, ok_mensuel, ok_instan, & 165 & ok_hf, ok_LES, & 176 call conf_phys( ok_journe, ok_mensuel, ok_instan, ok_hf, ok_LES, & 166 177 & solarlong0,seuil_inversion, & 167 178 & fact_cldcon, facttemps,ok_newmicro,iflag_radia, & 168 179 & iflag_cldcon, & 169 & iflag_ratqs,ratqsbas,ratqshaut, 180 & iflag_ratqs,ratqsbas,ratqshaut,tau_ratqs, & 170 181 & ok_ade, ok_aie, aerosol_couple, & 182 & flag_aerosol, new_aod, & 171 183 & bl95_b0, bl95_b1, & 172 184 & iflag_thermals,nsplit_thermals,tau_thermals, & 173 185 & iflag_thermals_ed,iflag_thermals_optflux, & 174 & iflag_coupl,iflag_clos,iflag_wake ) 186 & iflag_coupl,iflag_clos,iflag_wake, read_climoz ) 187 188 ! co2_ppm0 : initial value of atmospheric CO2 from .def file (co2_ppm value) 189 co2_ppm0 = co2_ppm 190 175 191 dtvr = daysec/FLOAT(day_step) 176 192 print*,'dtvr',dtvr 177 193 178 179 180 194 CALL iniconst() 181 195 CALL inigeom() 182 196 183 197 ! Initialisation pour traceurs 184 CALL infotrac_init 185 ALLOCATE(q3d(iip1,jjp1,llm,nqtot)) 186 198 call infotrac_init 199 ALLOCATE(q3d(iip1, jjp1, llm, nqtot)) 187 200 188 201 CALL inifilr() 189 CALL phys_state_var_init( )202 CALL phys_state_var_init(read_climoz) 190 203 ! 191 204 latfi(1) = ASIN(1.0) … … 244 257 245 258 write(*,*)'Essai de lecture masque ocean' 246 iret = nf _open("o2a.nc", NF_NOWRITE, nid_o2a)259 iret = nf90_open("o2a.nc", NF90_NOWRITE, nid_o2a) 247 260 if (iret .ne. 0) then 248 261 write(*,*)'ATTENTION!! pas de fichier o2a.nc trouve' … … 263 276 else 264 277 couple = .true. 265 iret = nf _close(nid_o2a)278 iret = nf90_close(nid_o2a) 266 279 call flininfo("o2a.nc", iml_omask, jml_omask, llm_tmp, ttm_tmp 267 280 $ , nid_o2a) … … 400 413 . maxval(qsat(:,:,:)) 401 414 ! 402 WRITE(*,*) 'QSAT :', qsat(10,20,:)415 CC WRITE(*,*) 'QSAT :', qsat(10,20,:) 403 416 ! 404 417 varname = 'q' … … 411 424 q3d(:,:,:,1) = qd(:,:,:) 412 425 ! 426 427 ! Ozone climatology: 428 if (read_climoz >= 1) call regr_lat_time_climoz(read_climoz) 429 413 430 varname = 'tsol' 414 431 ! This line needs to be replaced by a call to restget to get the values in the restart file … … 475 492 . jjm, rlonu, rlatv , interbar ) 476 493 c 477 rugsrel(:) = 0.0478 IF(ok_orodr) THEN479 DO i = 1, iip1* jjp1480 rugsrel(i) = MAX( 1.e-05, zstd(i)* zsig(i) /2. )481 ENDDO482 ENDIF494 cc rugsrel(:) = 0.0 495 cc IF(ok_orodr) THEN 496 cc DO i = 1, iip1* jjp1 497 cc rugsrel(i) = MAX( 1.e-05, zstd(i)* zsig(i) /2. ) 498 cc ENDDO 499 cc ENDIF 483 500 484 501 … … 650 667 itau_phy = 0 651 668 iday = dayref +itau/day_step 652 time = FLOAT(itau-(iday-dayref)*day_step)/day_step669 time = real(itau-(iday-dayref)*day_step)/day_step 653 670 c 654 671 IF(time.GT.1) THEN … … 714 731 q_ancien = 0. 715 732 agesno = 0. 733 c 716 734 frugs(1:klon,is_oce) = rugmer(1:klon) 717 735 frugs(1:klon,is_ter) = MAX(1.0e-05, zstd(1:klon)*zsig(1:klon)/2.0) … … 750 768 751 769 C Sortie Visu pour les champs dynamiques 752 if (1.eq.0 ) then753 print*,'sortie visu'754 time_step = 1.755 t_ops = 2.756 t_wrt = 2.757 itau = 2.758 visu_file='Etat0_visu.nc'759 CALL initdynav(visu_file,dayref,anneeref,time_step,760 . t_ops, t_wrt, visuid)761 CALL writedynav(visuid, itau,vvent ,762 . uvent,tpot,pk,phi,q3d,masse,psol,phis)763 else770 cc if (1.eq.0 ) then 771 cc print*,'sortie visu' 772 cc time_step = 1. 773 cc t_ops = 2. 774 cc t_wrt = 2. 775 cc itau = 2. 776 cc visu_file='Etat0_visu.nc' 777 cc CALL initdynav(visu_file,dayref,anneeref,time_step, 778 cc . t_ops, t_wrt, visuid) 779 cc CALL writedynav(visuid, itau,vvent , 780 cc . uvent,tpot,pk,phi,q3d,masse,psol,phis) 781 cc else 764 782 print*,'CCCCCCCCCCCCCCCCCC REACTIVER SORTIE VISU DANS ETAT0' 765 endif783 cc endif 766 784 print*,'entree histclo' 767 785 CALL histclo 768 769 DEALLOCATE(q3d)770 786 771 787 #endif … … 774 790 ! 775 791 END SUBROUTINE etat0_netcdf 776 -
LMDZ4/trunk/libf/dyn3d/fluxstokenc.F
r1146 r1279 1 ! 2 ! $Id$ 3 ! 1 4 SUBROUTINE fluxstokenc(pbaru,pbarv,masse,teta,phi,phis, 2 5 . time_step,itau ) 6 #ifdef CPP_EARTH 7 ! This routine is designed to work for Earth and with ioipsl 3 8 4 9 USE IOIPSL … … 18 23 #include "tracstoke.h" 19 24 #include "temps.h" 25 #include "iniprint.h" 20 26 21 27 REAL time_step,t_wrt, t_ops … … 159 165 ENDIF ! if iadvtr.EQ.istdyn 160 166 167 #else 168 write(lunout,*) 169 & 'fluxstokenc: Needs Earth physics (and ioipsl) to function' 170 #endif 171 ! of #ifdef CPP_EARTH 161 172 RETURN 162 173 END -
LMDZ4/trunk/libf/dyn3d/fxhyp.F
r650 r1279 48 48 c 49 49 REAL dzoom 50 REAL *8xlon(iip1),xprimm(iip1),xuv51 REAL *8xtild(0:nmax2)52 REAL *8fhyp(0:nmax2),ffdx,beta,Xprimt(0:nmax2)53 REAL *8Xf(0:nmax2),xxpr(0:nmax2)54 REAL *8xvrai(iip1),xxprim(iip1)55 REAL *8pi,depi,epsilon,xzoom,fa,fb56 REAL *8Xf1, Xfi , a0,a1,a2,a3,xi250 REAL(KIND=8) xlon(iip1),xprimm(iip1),xuv 51 REAL(KIND=8) xtild(0:nmax2) 52 REAL(KIND=8) fhyp(0:nmax2),ffdx,beta,Xprimt(0:nmax2) 53 REAL(KIND=8) Xf(0:nmax2),xxpr(0:nmax2) 54 REAL(KIND=8) xvrai(iip1),xxprim(iip1) 55 REAL(KIND=8) pi,depi,epsilon,xzoom,fa,fb 56 REAL(KIND=8) Xf1, Xfi , a0,a1,a2,a3,xi2 57 57 INTEGER i,it,ik,iter,ii,idif,ii1,ii2 58 REAL *8xi,xo1,xmoy,xlon2,fxm,Xprimin59 REAL *8champmin,champmax,decalx58 REAL(KIND=8) xi,xo1,xmoy,xlon2,fxm,Xprimin 59 REAL(KIND=8) champmin,champmax,decalx 60 60 INTEGER is2 61 61 SAVE is2 62 62 63 REAL *8heavyside63 REAL(KIND=8) heavyside 64 64 65 65 pi = 2. * ASIN(1.) -
LMDZ4/trunk/libf/dyn3d/fxyhyper.F
r524 r1279 41 41 REAL rlonu(iip1),xprimu(iip1),rlonv(iip1),xprimv(iip1), 42 42 , rlonm025(iip1),xprimm025(iip1), rlonp025(iip1),xprimp025(iip1) 43 REAL *8dxmin, dxmax , dymin, dymax43 REAL(KIND=8) dxmin, dxmax , dymin, dymax 44 44 45 45 c .... var. locales ..... -
LMDZ4/trunk/libf/dyn3d/fyhyp.F
r650 r1279 50 50 51 51 REAL dzoom 52 REAL *8ylat(jjp1), yprim(jjp1)53 REAL *8yuv54 REAL *8yt(0:nmax2)55 REAL *8fhyp(0:nmax2),beta,Ytprim(0:nmax2),fxm(0:nmax2)52 REAL(KIND=8) ylat(jjp1), yprim(jjp1) 53 REAL(KIND=8) yuv 54 REAL(KIND=8) yt(0:nmax2) 55 REAL(KIND=8) fhyp(0:nmax2),beta,Ytprim(0:nmax2),fxm(0:nmax2) 56 56 SAVE Ytprim, yt,Yf 57 REAL *8Yf(0:nmax2),yypr(0:nmax2)58 REAL *8yvrai(jjp1), yprimm(jjp1),ylatt(jjp1)59 REAL *8pi,depi,pis2,epsilon,y0,pisjm60 REAL *8yo1,yi,ylon2,ymoy,Yprimin,champmin,champmax61 REAL *8yfi,Yf1,ffdy62 REAL *8ypn,deply,y0057 REAL(KIND=8) Yf(0:nmax2),yypr(0:nmax2) 58 REAL(KIND=8) yvrai(jjp1), yprimm(jjp1),ylatt(jjp1) 59 REAL(KIND=8) pi,depi,pis2,epsilon,y0,pisjm 60 REAL(KIND=8) yo1,yi,ylon2,ymoy,Yprimin,champmin,champmax 61 REAL(KIND=8) yfi,Yf1,ffdy 62 REAL(KIND=8) ypn,deply,y00 63 63 SAVE y00, deply 64 64 … … 66 66 INTEGER jpn,jjpn 67 67 SAVE jpn 68 REAL *8a0,a1,a2,a3,yi2,heavyy0,heavyy0m69 REAL *8fa(0:nmax2),fb(0:nmax2)68 REAL(KIND=8) a0,a1,a2,a3,yi2,heavyy0,heavyy0m 69 REAL(KIND=8) fa(0:nmax2),fb(0:nmax2) 70 70 REAL y0min,y0max 71 71 72 REAL *8heavyside72 REAL(KIND=8) heavyside 73 73 74 74 pi = 2. * ASIN(1.) -
LMDZ4/trunk/libf/dyn3d/gcm.F
r1147 r1279 1 ! 2 ! $Id$ 3 ! 1 4 c 2 5 c … … 110 113 real time_step, t_wrt, t_ops 111 114 112 REAL rdayvrai,rdaym_ini,rday_ecri113 115 LOGICAL first 114 116 … … 132 134 character (len=20) :: modname 133 135 character (len=80) :: abort_message 134 135 C Calendrier136 LOGICAL true_calendar137 PARAMETER (true_calendar = .false.) 136 ! locales pour gestion du temps 137 INTEGER :: an, mois, jour 138 REAL :: heure 139 138 140 139 141 c----------------------------------------------------------------------- … … 160 162 161 163 162 c-----------------------------------------------------------------------163 c Choix du calendrier164 c -------------------165 166 #ifdef CPP_IOIPSL167 if (true_calendar) then168 call ioconf_calendar('gregorian')169 else170 call ioconf_calendar('360d')171 endif172 #endif173 164 c---------------------------------------------------------------------- 174 165 c lecture des fichiers gcm.def ou run.def … … 194 185 endif 195 186 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 187 c----------------------------------------------------------------------- 188 c Choix du calendrier 189 c ------------------- 190 191 c calend = 'earth_365d' 192 193 #ifdef CPP_IOIPSL 194 if (calend == 'earth_360d') then 195 call ioconf_calendar('360d') 196 write(lunout,*)'CALENDRIER CHOISI: Terrestre a 360 jours/an' 197 else if (calend == 'earth_365d') then 198 call ioconf_calendar('noleap') 199 write(lunout,*)'CALENDRIER CHOISI: Terrestre a 365 jours/an' 200 else if (calend == 'earth_366d') then 201 call ioconf_calendar('gregorian') 202 write(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile' 203 else 204 abort_message = 'Mauvais choix de calendrier' 205 call abort_gcm(modname,abort_message,1) 206 endif 207 #endif 208 c----------------------------------------------------------------------- 196 209 197 210 IF (config_inca /= 'none') THEN … … 294 307 . ' restart ne correspondent pas a celles lues dans ' 295 308 write(lunout,*)' gcm.def' 309 write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref 310 write(lunout,*)' day_ref=',day_ref," dayref=",dayref 296 311 if (raz_date .ne. 1) then 297 312 write(lunout,*) … … 310 325 raz_date = 0 311 326 endif 327 312 328 #ifdef CPP_IOIPSL 313 call ioconf_startdate(annee_ref,0,day_ref, 0.) 314 #endif 315 329 mois = 1 330 heure = 0. 331 call ymds2ju(annee_ref, mois, day_ref, heure, jD_ref) 332 jH_ref = jD_ref - int(jD_ref) 333 jD_ref = int(jD_ref) 334 335 call ioconf_startdate(INT(jD_ref), jH_ref) 336 337 write(lunout,*)'DEBUG' 338 write(lunout,*)'annee_ref, mois, day_ref, heure, jD_ref' 339 write(lunout,*)annee_ref, mois, day_ref, heure, jD_ref 340 call ju2ymds(jD_ref+jH_ref,an, mois, jour, heure) 341 write(lunout,*)'jD_ref+jH_ref,an, mois, jour, heure' 342 write(lunout,*)jD_ref+jH_ref,an, mois, jour, heure 343 #else 344 ! Ehouarn: we still need to define JD_ref and JH_ref 345 ! and since we don't know how many days there are in a year 346 ! we set JD_ref to 0 (this should be improved ...) 347 jD_ref=0 348 jH_ref=0 349 #endif 316 350 317 351 c nombre d'etats dans les fichiers demarrage et histoire … … 388 422 300 FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//) 389 423 424 #ifdef CPP_IOIPSL 425 call ju2ymds(jD_ref + day_ini - day_ref, an, mois, jour, heure) 426 write (lunout,301)jour, mois, an 427 call ju2ymds(jD_ref + day_end - day_ref, an, mois, jour, heure) 428 write (lunout,302)jour, mois, an 429 301 FORMAT('1'/,15x,'run du ', i2,'/',i2,'/',i4) 430 302 FORMAT('1'/,15x,' au ', i2,'/',i2,'/',i4) 431 #endif 432 390 433 if (planet_type.eq."earth") then 391 #ifdef CPP_EARTH 392 CALL dynredem0("restart.nc", day_end, phis) 393 #endif 434 CALL dynredem0("restart.nc", day_end, phis) 394 435 endif 395 436 … … 401 442 t_ops = iecri * daysec 402 443 t_wrt = iecri * daysec 403 CALL inithist(dynhist_file,day_ref,annee_ref,time_step,404 405 406 407 408 409 410 411 444 ! CALL inithist(dynhist_file,day_ref,annee_ref,time_step, 445 ! . t_ops, t_wrt, histid, histvid) 446 447 ! IF (ok_dynzon) THEN 448 ! t_ops = iperiod * time_step 449 ! t_wrt = periodav * daysec 450 ! CALL initdynav(dynhistave_file,day_ref,annee_ref,time_step, 451 ! . t_ops, t_wrt, histaveid) 452 ! END IF 412 453 dtav = iperiod*dtvr/daysec 413 454 endif -
LMDZ4/trunk/libf/dyn3d/getparam.F90
r524 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 MODULE getparam 5 #ifdef CPP_IOIPSL 5 6 USE IOIPSL 7 #else 8 ! if not using IOIPSL, we still need to use (a local version of) getin 9 USE ioipsl_getincom 10 #endif 11 6 12 INTERFACE getpar 7 13 MODULE PROCEDURE ini_getparam,fin_getparam,getparamr,getparami,getparaml -
LMDZ4/trunk/libf/dyn3d/grid_atob.F
r524 r1279 700 700 PARAMETER (imtmp=360,jmtmp=180) 701 701 REAL xtmp(imtmp), ytmp(jmtmp) 702 REAL *8cham1tmp(imtmp,jmtmp), cham2tmp(imtmp,jmtmp)702 REAL(KIND=8) cham1tmp(imtmp,jmtmp), cham2tmp(imtmp,jmtmp) 703 703 REAL zzzz 704 704 c … … 859 859 number(ii,jj) = number(ii,jj) + 1.0 860 860 rugs(ii,jj) = rugs(ii,jj) 861 . + LOG(MAX(0.001 ,cham2tmp(i,j)))861 . + LOG(MAX(0.001_8,cham2tmp(i,j))) 862 862 ENDIF 863 863 ENDDO … … 892 892 i_proche = ij_proche - (j_proche-1)*imtmp 893 893 PRINT*, "solution:", ij_proche, i_proche, j_proche 894 rugs(i,j) = LOG(MAX(0.001 ,cham2tmp(i_proche,j_proche)))894 rugs(i,j) = LOG(MAX(0.001_8,cham2tmp(i_proche,j_proche))) 895 895 ENDIF 896 896 ENDDO -
LMDZ4/trunk/libf/dyn3d/groupeun.F
r1146 r1279 19 19 REAL airecs,qs 20 20 21 INTEGER i,j,l,ig, j1,j2,i0,jd21 INTEGER i,j,l,ig,ig2,j1,j2,i0,jd 22 22 23 23 c--------------------------------------------------------------------c … … 37 37 38 38 LOGICAL, SAVE :: first = .TRUE. 39 INTEGER,SAVE :: i_index(iim,ngroup) 40 INTEGER :: offset 41 REAL :: qsum(iim/ngroup) 39 42 40 43 IF (first) THEN … … 43 46 ENDIF 44 47 48 45 49 c Champs 3D 46 50 jd=jjp1-jjmax 47 51 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 48 52 DO l=1,llm 49 53 j1=1+jd … … 54 58 j_start = j1-jd 55 59 j_finish = j2-jd 56 DO j=j_start, j_finish 57 DO i0=1,iim,2**(ngroup-ig+1) 58 qn=0. 59 DO i=i0,i0+2**(ngroup-ig+1)-1 60 qn=qn+q(i,j,l) 61 ENDDO 62 DO i=i0,i0+2**(ngroup-ig+1)-1 63 q(i,j,l)=qn*airen_tab(i,j,jd) 64 ENDDO 60 DO ig2=1,ngroup-ig+1 61 offset=2**(ig2-1) 62 DO j=j_start, j_finish 63 !CDIR NODEP 64 !CDIR ON_ADB(q) 65 DO i0=1,iim,2**ig2 66 q(i0,j,l)=q(i0,j,l)+q(i0+offset,j,l) 67 ENDDO 68 ENDDO 69 ENDDO 70 71 DO j=j_start, j_finish 72 !CDIR NODEP 73 !CDIR ON_ADB(q) 74 DO i=1,iim 75 q(i,j,l)=q(i-MOD(i-1,2**(ngroup-ig+1)),j,l) 76 ENDDO 77 ENDDO 78 79 DO j=j_start, j_finish 80 !CDIR ON_ADB(airen_tab) 81 !CDIR ON_ADB(q) 82 DO i=1,iim 83 q(i,j,l)=q(i,j,l)*airen_tab(i,j,jd) 65 84 ENDDO 66 85 q(iip1,j,l)=q(1,j,l) 67 86 ENDDO 68 87 69 88 !c Concerne le pole sud 70 89 j_start = j1-jd 71 90 j_finish = j2-jd 72 DO j=j_start, j_finish 73 DO i0=1,iim,2**(ngroup-ig+1) 74 qs=0. 75 DO i=i0,i0+2**(ngroup-ig+1)-1 76 qs=qs+q(i,jjp1-j+1-jd,l) 77 ENDDO 78 DO i=i0,i0+2**(ngroup-ig+1)-1 79 q(i,jjp1-j+1-jd,l)=qs*aires_tab(i,jjp1-j+1,jd) 80 ENDDO 91 DO ig2=1,ngroup-ig+1 92 offset=2**(ig2-1) 93 DO j=j_start, j_finish 94 !CDIR NODEP 95 !CDIR ON_ADB(q) 96 DO i0=1,iim,2**ig2 97 q(i0,jjp1-j+1-jd,l)= q(i0,jjp1-j+1-jd,l) 98 & +q(i0+offset,jjp1-j+1-jd,l) 99 ENDDO 100 ENDDO 101 ENDDO 102 103 104 DO j=j_start, j_finish 105 !CDIR NODEP 106 !CDIR ON_ADB(q) 107 DO i=1,iim 108 q(i,jjp1-j+1-jd,l)=q(i-MOD(i-1,2**(ngroup-ig+1)), 109 & jjp1-j+1-jd,l) 110 ENDDO 111 ENDDO 112 113 DO j=j_start, j_finish 114 !CDIR ON_ADB(aires_tab) 115 !CDIR ON_ADB(q) 116 DO i=1,iim 117 q(i,jjp1-j+1-jd,l)=q(i,jjp1-j+1-jd,l)* 118 & aires_tab(i,jjp1-j+1,jd) 81 119 ENDDO 82 120 q(iip1,jjp1-j+1-jd,l)=q(1,jjp1-j+1-jd,l) 83 121 ENDDO 122 84 123 85 124 j1=j2+1 … … 87 126 ENDDO 88 127 ENDDO 128 !$OMP END DO NOWAIT 89 129 90 130 RETURN 91 131 END 92 93 94 132 133 134 135 95 136 SUBROUTINE INIT_GROUPEUN(airen_tab, aires_tab) 96 137 IMPLICIT NONE -
LMDZ4/trunk/libf/dyn3d/heavyside.F
r524 r1279 10 10 IMPLICIT NONE 11 11 12 REAL *8heavyside , a12 REAL(KIND=8) heavyside , a 13 13 14 14 IF ( a.LE.0. ) THEN -
LMDZ4/trunk/libf/dyn3d/infotrac.F90
r1146 r1279 1 ! $Id$ 2 ! 1 3 MODULE infotrac 2 4 … … 19 21 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: niadv ! equivalent dyn / physique 20 22 21 ! Variables for INCA23 ! conv_flg(it)=0 : convection desactivated for tracer number it 22 24 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: conv_flg 25 ! pbl_flg(it)=0 : boundary layer diffusion desactivaded for tracer number it 23 26 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: pbl_flg 24 27 28 CHARACTER(len=4),SAVE :: type_trac 29 25 30 CONTAINS 26 31 … … 51 56 INTEGER, ALLOCATABLE, DIMENSION(:) :: vadv ! index of vertical trasport schema 52 57 53 CHARACTER(len= 8), ALLOCATABLE, DIMENSION(:) :: tnom_0 ! tracer short name58 CHARACTER(len=15), ALLOCATABLE, DIMENSION(:) :: tnom_0 ! tracer short name 54 59 CHARACTER(len=8), ALLOCATABLE, DIMENSION(:) :: tracnam ! name from INCA 55 60 CHARACTER(len=3), DIMENSION(30) :: descrq … … 78 83 descrq(20)='SLP' 79 84 descrq(30)='PRA' 85 86 87 IF (config_inca=='none') THEN 88 type_trac='lmdz' 89 ELSE 90 type_trac='inca' 91 END IF 80 92 81 93 !----------------------------------------------------------------------- … … 85 97 ! 86 98 !----------------------------------------------------------------------- 87 IF ( config_inca == 'none') THEN99 IF (type_trac == 'lmdz') THEN 88 100 OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr) 89 101 IF(ierr.EQ.0) THEN … … 107 119 END IF 108 120 ! 109 ! Allocate variables depending on nqtrue 121 ! Allocate variables depending on nqtrue and nbtr 110 122 ! 111 123 ALLOCATE(tnom_0(nqtrue), hadv(nqtrue), vadv(nqtrue)) 112 113 IF (config_inca /= 'none') THEN 114 ! Varaibles only needed in case of INCA 115 ALLOCATE(conv_flg(nbtr), pbl_flg(nbtr), tracnam(nbtr)) 116 END IF 117 124 ALLOCATE(conv_flg(nbtr), pbl_flg(nbtr), tracnam(nbtr)) 125 conv_flg(:) = 1 ! convection activated for all tracers 126 pbl_flg(:) = 1 ! boundary layer activated for all tracers 127 118 128 !----------------------------------------------------------------------- 119 129 ! 2) Choix des schemas d'advection pour l'eau et les traceurs … … 142 152 ! Get choice of advection schema from file tracer.def or from INCA 143 153 !--------------------------------------------------------------------- 144 IF ( config_inca == 'none') THEN154 IF (type_trac == 'lmdz') THEN 145 155 IF(ierr.EQ.0) THEN 146 156 ! Continue to read tracer.def … … 170 180 END DO 171 181 172 ELSE ! config_inca='aero' ou 'chem'182 ELSE ! type_trac=inca : config_inca='aero' ou 'chem' 173 183 ! le module de chimie fournit les noms des traceurs 174 184 ! et les schemas d'advection associes. … … 189 199 END DO 190 200 191 END IF ! config_inca201 END IF ! type_trac 192 202 193 203 !----------------------------------------------------------------------- … … 293 303 294 304 295 WRITE(lunout,*) 'Information stored in dimtrac :'305 WRITE(lunout,*) 'Information stored in infotrac :' 296 306 WRITE(lunout,*) 'iadv niadv tname ttext :' 297 307 DO iq=1,nqtot … … 299 309 END DO 300 310 311 ! 312 ! Test for advection schema. 313 ! This version of LMDZ only garantees iadv=10 and iadv=14 (14 only for water vapour) . 314 ! 315 DO iq=1,nqtot 316 IF (iadv(iq)/=10 .AND. iadv(iq)/=14 .AND. iadv(iq)/=0) THEN 317 WRITE(lunout,*)'STOP : The option iadv=',iadv(iq),' is not tested in this version of LMDZ' 318 CALL abort_gcm('infotrac_init','In this version only iadv=10 and iadv=14 is tested!',1) 319 ELSE IF (iadv(iq)==14 .AND. iq/=1) THEN 320 WRITE(lunout,*)'STOP : The option iadv=',iadv(iq),' is not tested in this version of LMDZ' 321 CALL abort_gcm('infotrac_init','In this version iadv=14 is only permitted for water vapour!',1) 322 END IF 323 END DO 324 301 325 !----------------------------------------------------------------------- 302 326 ! Finalize : 303 327 ! 304 328 DEALLOCATE(tnom_0, hadv, vadv) 305 IF (config_inca /= 'none')DEALLOCATE(tracnam)306 307 999 FORMAT (i2,1x,i2,1x,a 8)329 DEALLOCATE(tracnam) 330 331 999 FORMAT (i2,1x,i2,1x,a15) 308 332 309 333 END SUBROUTINE infotrac_init -
LMDZ4/trunk/libf/dyn3d/ini_paramLMDZ_dyn.h
r956 r1279 2 2 dt_cum = dtvr*day_step 3 3 4 zan = annee_ref5 dayref = day_ref6 CALL ymds2ju(zan, 1, dayref, 0.0, zjulian)4 ! zan = annee_ref 5 ! dayref = day_ref 6 ! CALL ymds2ju(zan, 1, dayref, 0.0, zjulian) 7 7 tau0 = itau_dyn 8 8 c … … 15 15 . iip1,rlong, jjp1,rlatg, 16 16 . 1,1,1,1, 17 . tau0, zjulian, dt_cum,17 . tau0, jD_ref+jH_ref , dt_cum, 18 18 . thoriid, nid_ctesGCM) 19 19 c … … 134 134 c 135 135 CALL histdef(nid_ctesGCM, "true_calendar", 136 ."Choix du calendrier : 1=gregorien ,0=calen. a 360 j",136 ."Choix du calendrier", 137 137 . "-",iip1,jjp1,thoriid, 1,1,1, -99, 32, 138 138 . "once", dt_cum,dt_cum) -
LMDZ4/trunk/libf/dyn3d/iniacademic.F
r1146 r1279 83 83 c 84 84 time_0=0. 85 day_ref=0 86 annee_ref=0 85 87 86 88 im = iim -
LMDZ4/trunk/libf/dyn3d/inidissip.F
r524 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 SUBROUTINE inidissip ( lstardis,nitergdiv,nitergrot,niterh , … … 18 18 #include "comvert.h" 19 19 #include "control.h" 20 #include "logic.h" 20 21 21 22 LOGICAL lstardis … … 29 30 INTEGER l,ij,idum,ii 30 31 REAL tetamin 32 REAL pseudoz 31 33 32 34 REAL ran1 … … 174 176 c -------------------------------------------------- 175 177 176 DO l=1,llm 177 zvert(l)=1. 178 ENDDO 179 180 fact=2. 181 c 182 DO l = 1, llm 183 zz = 1. - preff/presnivs(l) 184 zvert(l)= fact -( fact-1.)/( 1.+zz*zz ) 185 ENDDO 178 if (ok_strato .and. llm==39) then 179 do l=1,llm 180 pseudoz=8.*log(preff/presnivs(l)) 181 zvert(l)=1+ 182 s (tanh((pseudoz-dissip_zref)/dissip_deltaz)+1.)/2. 183 s *(dissip_factz-1.) 184 enddo 185 else 186 DO l=1,llm 187 zvert(l)=1. 188 ENDDO 189 fact=2. 190 DO l = 1, llm 191 zz = 1. - preff/presnivs(l) 192 zvert(l)= fact -( fact-1.)/( 1.+zz*zz ) 193 ENDDO 194 endif 186 195 187 196 -
LMDZ4/trunk/libf/dyn3d/integrd.F
r1146 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 SUBROUTINE integrd … … 32 32 #include "temps.h" 33 33 #include "serre.h" 34 #include "control.h" 34 35 35 36 c Arguments: … … 183 184 c$$$ ENDIF 184 185 185 DO l = 1, llm 186 DO ij = 1, ip1jmp1 187 deltap(ij,l) = p(ij,l) - p(ij,l+1) 186 if (planet_type.eq."earth") then 187 ! Earth-specific treatment of first 2 tracers (water) 188 DO l = 1, llm 189 DO ij = 1, ip1jmp1 190 deltap(ij,l) = p(ij,l) - p(ij,l+1) 191 ENDDO 188 192 ENDDO 189 ENDDO 190 191 CALL qminimum( q, nq, deltap ) 193 194 CALL qminimum( q, nq, deltap ) 195 endif ! of if (planet_type.eq."earth") 196 192 197 c 193 198 c ..... Calcul de la valeur moyenne, unique aux poles pour q ..... -
LMDZ4/trunk/libf/dyn3d/inter_barx.F
r790 r1279 212 212 213 213 214 3 FORMAT(1x,70( 1h-))214 3 FORMAT(1x,70("-")) 215 215 2 FORMAT(1x,8f8.2) 216 216 -
LMDZ4/trunk/libf/dyn3d/leapfrog.F
r1146 r1279 1 ! 2 ! $Id$ 1 3 ! 2 4 c … … 11 13 #endif 12 14 USE infotrac 13 15 USE guide_mod, ONLY : guide_main 16 USE write_field 14 17 IMPLICIT NONE 15 18 … … 111 114 c 112 115 INTEGER itau,itaufinp1,iav 113 INTEGER*4iday ! jour julien114 REAL time ! Heure de la journee en fraction d'1 jour116 ! INTEGER iday ! jour julien 117 REAL time 115 118 116 119 REAL SSUM … … 124 127 real time_step, t_wrt, t_ops 125 128 126 REAL rdayvrai,rdaym_ini 129 ! REAL rdayvrai,rdaym_ini 130 ! jD_cur: jour julien courant 131 ! jH_cur: heure julienne courante 132 REAL :: jD_cur, jH_cur 133 INTEGER :: an, mois, jour 134 REAL :: secondes 135 127 136 LOGICAL first,callinigrads 128 137 cIM : pour sortir les param. du modele dans un fis. netcdf 110106 129 138 save first 130 139 data first/.true./ 131 real dt_cum , zjulian140 real dt_cum 132 141 character*10 infile 133 142 integer zan, tau0, thoriid … … 166 175 character*80 abort_message 167 176 168 C Calendrier169 LOGICAL true_calendar170 PARAMETER (true_calendar = .false.)171 172 177 logical dissip_conservative 173 178 save dissip_conservative … … 192 197 193 198 itau = 0 194 iday = day_ini+itau/day_step195 time = FLOAT(itau-(iday-day_ini)*day_step)/day_step+time_0196 IF(time.GT.1.) THEN197 time = time-1.198 iday = iday+1199 ENDIF199 c$$$ iday = day_ini+itau/day_step 200 c$$$ time = FLOAT(itau-(iday-day_ini)*day_step)/day_step+time_0 201 c$$$ IF(time.GT.1.) THEN 202 c$$$ time = time-1. 203 c$$$ iday = iday+1 204 c$$$ ENDIF 200 205 201 206 … … 214 219 1 CONTINUE 215 220 221 jD_cur = jD_ref + day_ini - day_ref + int (itau * dtvr / daysec) 222 jH_cur = jH_ref + & 223 & (itau * dtvr / daysec - int(itau * dtvr / daysec)) 224 216 225 217 226 #ifdef CPP_IOIPSL 218 if (ok_guide.and.(itaufin-itau-1)*dtvr.gt.21600) then 219 call guide(itau,ucov,vcov,teta,q,masse,ps) 220 else 221 IF(prt_level>9)WRITE(lunout,*)'leapfrog: attention on ne ', 222 . 'guide pas les 6 dernieres heures' 227 if (ok_guide) then 228 call guide_main(itau,ucov,vcov,teta,q,masse,ps) 223 229 endif 224 230 #endif 231 232 225 233 c 226 234 c IF( MOD( itau, 10* day_step ).EQ.0 ) THEN … … 284 292 CALL geopot ( ip1jmp1, teta , pk , pks, phis , phi ) 285 293 294 time = jD_cur + jH_cur 286 295 CALL caldyn 287 296 $ ( itau,ucov,vcov,teta,ps,masse,pk,pkf,phis , 288 $ phi,conser,du,dv,dteta,dp,w, pbaru,pbarv, time+iday-day_ini ) 297 $ phi,conser,du,dv,dteta,dp,w, pbaru,pbarv, time ) 298 289 299 290 300 c----------------------------------------------------------------------- … … 344 354 CALL exner_hyb( ip1jmp1, ps, p,alpha,beta,pks, pk, pkf ) 345 355 346 rdaym_ini = itau * dtvr / daysec 347 rdayvrai = rdaym_ini + day_ini 348 356 ! rdaym_ini = itau * dtvr / daysec 357 ! rdayvrai = rdaym_ini + day_ini 358 jD_cur = jD_ref + day_ini - day_ref 359 $ + int (itau * dtvr / daysec) 360 jH_cur = jH_ref + & 361 & (itau * dtvr / daysec - int(itau * dtvr / daysec)) 362 ! write(lunout,*)'itau, jD_cur = ', itau, jD_cur, jH_cur 363 ! call ju2ymds(jD_cur+jH_cur, an, mois, jour, secondes) 364 ! write(lunout,*)'current date = ',an, mois, jour, secondes 349 365 350 366 c rajout debug … … 378 394 #endif 379 395 ! #endif of #ifdef CPP_IOIPSL 380 CALL calfis( lafin , rdayvrai,time,396 CALL calfis( lafin , jD_cur, jH_cur, 381 397 $ ucov,vcov,teta,q,masse,ps,p,pk,phis,phi , 382 398 $ du,dv,dteta,dq, … … 385 401 386 402 IF (ok_strato) THEN 387 CALL top_bound( vcov,ucov,teta, 403 CALL top_bound( vcov,ucov,teta,masse,dufi,dvfi,dtetafi) 388 404 ENDIF 389 405 … … 506 522 IF(forward. OR. leapf) THEN 507 523 itau= itau + 1 508 iday= day_ini+itau/day_step509 time= FLOAT(itau-(iday-day_ini)*day_step)/day_step+time_0510 IF(time.GT.1.) THEN511 time = time-1.512 iday = iday+1513 ENDIF524 c$$$ iday= day_ini+itau/day_step 525 c$$$ time= FLOAT(itau-(iday-day_ini)*day_step)/day_step+time_0 526 c$$$ IF(time.GT.1.) THEN 527 c$$$ time = time-1. 528 c$$$ iday = iday+1 529 c$$$ ENDIF 514 530 ENDIF 515 531 … … 517 533 IF( itau. EQ. itaufinp1 ) then 518 534 if (flag_verif) then 519 write( 80,*) 'ucov',ucov520 write(8 1,*) 'vcov',vcov521 write(8 2,*) 'teta',teta522 write(8 3,*) 'ps',ps523 write(8 4,*) 'q',q535 write(79,*) 'ucov',ucov 536 write(80,*) 'vcov',vcov 537 write(81,*) 'teta',teta 538 write(82,*) 'ps',ps 539 write(83,*) 'q',q 524 540 WRITE(85,*) 'q1 = ',q(:,:,1) 525 541 WRITE(86,*) 'q3 = ',q(:,:,3) 526 write(90) ucov527 write(91) vcov528 write(92) teta529 write(93) ps530 write(94) q531 542 endif 532 543 … … 548 559 IF (ok_dynzon) THEN 549 560 #ifdef CPP_IOIPSL 550 CALL writedynav(histaveid, itau,vcov ,551 , ucov,teta,pk,phi,q,masse,ps,phis)561 ! CALL writedynav(histaveid, itau,vcov , 562 ! , ucov,teta,pk,phi,q,masse,ps,phis) 552 563 CALL bilan_dyn (2,dtvr*iperiod,dtvr*day_step*periodav, 553 564 , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) … … 586 597 587 598 if (planet_type.eq."earth") then 588 #ifdef CPP_EARTH589 599 ! Write an Earth-format restart file 590 600 CALL dynredem1("restart.nc",0.0, 591 601 & vcov,ucov,teta,q,masse,ps) 592 #endif593 602 endif ! of if (planet_type.eq."earth") 594 603 … … 636 645 637 646 itau = itau + 1 638 iday = day_ini+itau/day_step639 time = FLOAT(itau-(iday-day_ini)*day_step)/day_step+time_0640 641 IF(time.GT.1.) THEN642 time = time-1.643 iday = iday+1644 ENDIF647 c$$$ iday = day_ini+itau/day_step 648 c$$$ time = FLOAT(itau-(iday-day_ini)*day_step)/day_step+time_0 649 c$$$ 650 c$$$ IF(time.GT.1.) THEN 651 c$$$ time = time-1. 652 c$$$ iday = iday+1 653 c$$$ ENDIF 645 654 646 655 forward = .FALSE. … … 662 671 IF (ok_dynzon) THEN 663 672 #ifdef CPP_IOIPSL 664 CALL writedynav(histaveid, itau,vcov ,665 , ucov,teta,pk,phi,q,masse,ps,phis)673 ! CALL writedynav(histaveid, itau,vcov , 674 ! , ucov,teta,pk,phi,q,masse,ps,phis) 666 675 CALL bilan_dyn (2,dtvr*iperiod,dtvr*day_step*periodav, 667 676 , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) … … 693 702 IF(itau.EQ.itaufin) THEN 694 703 if (planet_type.eq."earth") then 695 #ifdef CPP_EARTH696 704 CALL dynredem1("restart.nc",0.0, 697 705 & vcov,ucov,teta,q,masse,ps) 698 #endif699 706 endif ! of if (planet_type.eq."earth") 700 707 ENDIF ! of IF(itau.EQ.itaufin) -
LMDZ4/trunk/libf/dyn3d/limit_netcdf.F
r997 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 C 5 5 C 6 6 SUBROUTINE limit_netcdf(interbar, extrap, oldice, masque) 7 #ifdef CPP_EARTH 8 ! This routine is designed to work for Earth 7 9 USE dimphy 8 10 use phys_state_var_mod , ONLY : pctsrf … … 33 35 cy#include "dimphy.h" 34 36 #include "indicesol.h" 37 #include "iniprint.h" 35 38 c 36 39 c----------------------------------------------------------------------- … … 403 406 ENDDO 404 407 405 PRINT 222, timeyear 408 PRINT 222, timeyear(:lmdep) 406 409 222 FORMAT(2x,' Time year ',10f6.1) 407 410 c … … 620 623 timeyear(l) = tmidmonth(l) 621 624 ENDDO 622 PRINT 222, timeyear 625 PRINT 222, timeyear(:lmdep) 623 626 c 624 627 PRINT*, 'Interpolation temporelle' … … 939 942 timeyear(l) = tmidmonth(l) 940 943 ENDDO 941 print 222, timeyear 944 print 222, timeyear(:lmdep) 942 945 c 943 946 C interpolation temporelle … … 1134 1137 timeyear(l) = timecoord(l) 1135 1138 ENDDO 1136 print 222, timeyear 1139 print 222, timeyear(:lmdep) 1137 1140 c 1138 1141 C interpolation temporelle … … 1323 1326 ierr = NF_CLOSE(nid) 1324 1327 c 1328 #else 1329 WRITE(lunout,*) 1330 & 'limit_netcdf: Earth-specific routine, needs Earth physics' 1331 #endif 1332 ! of #ifdef CPP_EARTH 1325 1333 STOP 1326 1334 END -
LMDZ4/trunk/libf/dyn3d/pres2lev.F
r1046 r1279 1 ! 2 ! $Header$ 1 ! $Id$ 3 2 ! 4 3 c****************************************************** … … 21 20 c ARGUMENTS 22 21 c """"""""" 23 LOGICAL ok_invertp24 INTEGER lmo ! dimensions ancienne couches (input)25 INTEGER lmn ! dimensions nouvelle couches (input)26 INTEGER lmomx ! dimensions ancienne couches (input)27 INTEGER lmnmx ! dimensions nouvelle couches (input)22 LOGICAL, INTENT(IN) :: ok_invertp 23 INTEGER, INTENT(IN) :: lmo ! dimensions ancienne couches 24 INTEGER, INTENT(IN) :: lmn ! dimensions nouvelle couches 25 INTEGER lmomx ! dimensions ancienne couches 26 INTEGER lmnmx ! dimensions nouvelle couches 28 27 29 28 parameter(lmomx=10000,lmnmx=10000) 30 29 31 real po(ni,nj,lmo)! niveau de pression ancienne grille32 real pn(ni,nj,lmn) ! niveau de pression nouvelle grille30 real, INTENT(IN) :: po(ni,nj,lmo) ! niveau de pression ancienne grille 31 real, INTENT(IN) :: pn(ni,nj,lmn) ! niveau de pression nouvelle grille 33 32 34 INTEGER i,j,Nhoriz,ni,nj ! nombre de point horizontale (input)33 INTEGER, INTENT(IN) :: ni,nj ! nombre de point horizontale 35 34 36 REAL varo(ni,nj,lmo) ! var dans l'ancienne grille (input)37 REAL varn(ni,nj,lmn) ! var dans la nouvelle grille (output)35 REAL, INTENT(IN) :: varo(ni,nj,lmo) ! var dans l'ancienne grille 36 REAL, INTENT(OUT) :: varn(ni,nj,lmn) ! var dans la nouvelle grille 38 37 39 38 real zvaro(lmomx),zpo(lmomx) … … 41 40 c Autres variables 42 41 c """""""""""""""" 43 INTEGER n, ln ,lo 42 INTEGER n, ln ,lo, i, j, Nhoriz 44 43 REAL coef 45 44 -
LMDZ4/trunk/libf/dyn3d/sortvarc.F
r524 r1279 129 129 ang = SSUM( llm, angl, 1 ) 130 130 131 rday = FLOAT(INT ( day_ini + time ))131 c rday = FLOAT(INT ( day_ini + time )) 132 132 c 133 rday = FLOAT(INT(time-jD_ref-jH_ref)) 133 134 IF(ptot0.eq.0.) THEN 134 135 PRINT 3500, itau, rday, heure,time … … 156 157 RETURN 157 158 158 3500 FORMAT( '0'10(1h*),4x,'pas'i7,5x,'jour'f5.0,'heure'f5.1,4x159 * ,'date',f1 0.5,4x,10(1h*))159 3500 FORMAT(10("*"),4x,'pas',i7,5x,'jour',f9.0,'heure',f5.1,4x 160 * ,'date',f14.4,4x,10("*")) 160 161 4000 FORMAT(10x,'masse',4x,'rmsdpdt',7x,'energie',2x,'enstrophie' 161 162 * ,2x,'entropie',3x,'rmsv',4x,'mt.ang',/,'GLOB ' -
LMDZ4/trunk/libf/dyn3d/sortvarc0.F
r524 r1279 130 130 ang0 = SSUM( llm, angl, 1 ) 131 131 132 rday = FLOAT(INT ( day_ini +time ))132 rday = FLOAT(INT (time )) 133 133 c 134 134 PRINT 3500, itau, rday, heure, time 135 135 PRINT *, ptot0,etot0,ztot0,stot0,ang0 136 136 137 3500 FORMAT( '0',10(1h*),4x,'pas',i7,5x,'jour',f5.0,'heure',f5.1,4x138 * ,'date',f10.5,4x,10( 1h*))137 3500 FORMAT(10("*"),4x,'pas',i7,5x,'jour',f5.0,'heure',f5.1,4x 138 * ,'date',f10.5,4x,10("*")) 139 139 RETURN 140 140 END -
LMDZ4/trunk/libf/dyn3d/startvar.F
r677 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 C5 C6 4 MODULE startvar 5 #ifdef CPP_EARTH 6 ! This module is designed to work for Earth (and with ioipsl) 7 7 ! 8 8 ! … … 1189 1189 END SUBROUTINE start_inter_3d 1190 1190 ! 1191 #endif 1192 ! of #ifdef CPP_EARTH 1191 1193 END MODULE startvar -
LMDZ4/trunk/libf/dyn3d/temps.h
r792 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 ! ATTENTION!!!!: ce fichier include est compatible format fixe/format libre … … 8 8 ! 9 9 ! 10 ! jD_ref = jour julien de la date de reference (lancement de l'experience) 11 ! hD_ref = "heure" julienne de la date de reference 10 12 !----------------------------------------------------------------------- 11 13 ! INCLUDE 'temps.h' 12 14 13 15 COMMON/temps/itaufin, dt, day_ini, day_end, annee_ref, day_ref, & 14 & itau_dyn, itau_phy 16 & itau_dyn, itau_phy, jD_ref, jH_ref, calend 15 17 16 18 INTEGER itaufin 17 INTEGER*4 itau_dyn, itau_phy 18 INTEGER*4 day_ini, day_end, annee_ref, day_ref 19 REAL dt 19 INTEGER itau_dyn, itau_phy 20 INTEGER day_ini, day_end, annee_ref, day_ref 21 REAL dt, jD_ref, jH_ref 22 CHARACTER (len=10) :: calend 20 23 21 24 !----------------------------------------------------------------------- -
LMDZ4/trunk/libf/dyn3d/top_bound.F
r999 r1279 1 SUBROUTINE top_bound( vcov,ucov,teta, du,dv,dh )1 SUBROUTINE top_bound( vcov,ucov,teta,masse, du,dv,dh ) 2 2 IMPLICIT NONE 3 3 c … … 5 5 #include "paramet.h" 6 6 #include "comconst.h" 7 CC#include "comgeom2.h" 7 #include "comvert.h" 8 #include "comgeom2.h" 8 9 9 10 … … 27 28 c ------------- 28 29 29 #include "comgeom.h"30 ! #include "comgeom.h" 30 31 #include "comdissipn.h" 31 32 … … 34 35 35 36 REAL ucov(iip1,jjp1,llm),vcov(iip1,jjm,llm),teta(iip1,jjp1,llm) 37 REAL masse(iip1,jjp1,llm) 36 38 REAL dv(iip1,jjm,llm),du(iip1,jjp1,llm),dh(iip1,jjp1,llm) 37 39 … … 39 41 c ------ 40 42 43 REAL massebx(iip1,jjp1,llm),masseby(iip1,jjm,llm),zm 41 44 REAL uzon(jjp1,llm),vzon(jjm,llm),tzon(jjp1,llm) 42 45 43 46 INTEGER NDAMP 44 47 PARAMETER (NDAMP=4) 45 integer i 46 REAL :: rdamp(llm) = 47 & (/(0., i =1,llm-NDAMP),0.125E-5,.25E-5,.5E-5,1.E-5/) 48 integer i 49 REAL,SAVE :: rdamp(llm) 50 ! & (/(0., i =1,llm-NDAMP),0.125E-5,.25E-5,.5E-5,1.E-5/) 51 52 LOGICAL,SAVE :: first=.true. 48 53 49 54 INTEGER j,l … … 52 57 C CALCUL DES CHAMPS EN MOYENNE ZONALE: 53 58 59 if (iflag_top_bound.eq.0) return 60 61 if (first) then 62 if (iflag_top_bound.eq.1) then 63 ! couche eponge dans les 4 dernieres couches du modele 64 rdamp(:)=0. 65 rdamp(llm)=tau_top_bound 66 rdamp(llm-1)=tau_top_bound/2. 67 rdamp(llm-2)=tau_top_bound/4. 68 rdamp(llm-3)=tau_top_bound/8. 69 else if (iflag_top_bound.eq.2) then 70 ! couce eponge dans toutes les couches de pression plus faible que 71 ! 100 fois la pression de la derniere couche 72 rdamp(:)=tau_top_bound 73 s *max(presnivs(llm)/presnivs(:)-0.01,0.) 74 endif 75 first=.false. 76 print*,'TOP_BOUND rdamp=',rdamp 77 endif 78 79 CALL massbar(masse,massebx,masseby) 80 54 81 do l=1,llm 55 82 do j=1,jjm 56 83 vzon(j,l)=0. 84 zm=0. 57 85 do i=1,iim 58 vzon(j,l)=vzon(j,l)+vcov(i,j,l)/float(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 89 vzon(j,l)=vzon(j,l)+vcov(i,j,l)*masseby(i,j,l) 90 zm=zm+masseby(i,j,l) 59 91 enddo 92 vzon(j,l)=vzon(j,l)/zm 60 93 enddo 61 94 enddo … … 72 105 do j=2,jjm 73 106 uzon(j,l)=0. 107 zm=0. 108 do i=1,iim 109 uzon(j,l)=uzon(j,l)+massebx(i,j,l)*ucov(i,j,l)/cu(i,j) 110 zm=zm+massebx(i,j,l) 111 enddo 112 uzon(j,l)=uzon(j,l)/zm 113 enddo 114 enddo 115 116 do l=1,llm 117 do j=2,jjm 118 zm=0. 74 119 tzon(j,l)=0. 75 120 do i=1,iim 76 uzon(j,l)=uzon(j,l)+ucov(i,j,l)/float(iim)77 tzon(j,l)=tzon(j,l)+teta(i,j,l)/float(iim)121 tzon(j,l)=tzon(j,l)+teta(i,j,l)*masse(i,j,l) 122 zm=zm+masse(i,j,l) 78 123 enddo 124 tzon(j,l)=tzon(j,l)/zm 79 125 enddo 80 126 enddo … … 85 131 do i=1,iip1 86 132 do j=2,jjm 87 du(i,j,l)=du(i,j,l)-rdamp(l)*(ucov(i,j,l)-uzon(j,l)) 133 du(i,j,l)=du(i,j,l) 134 s -rdamp(l)*(ucov(i,j,l)-cu(i,j)*uzon(j,l)) 88 135 dh(i,j,l)=dh(i,j,l)-rdamp(l)*(teta(i,j,l)-tzon(j,l)) 89 136 enddo -
LMDZ4/trunk/libf/dyn3d/ugeostr.F
r524 r1279 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 subroutine ugeostr(phi,ucov) … … 20 20 21 21 real zlat 22 23 um(:,:)=0 ! initialize um() 22 24 23 25 DO j=1,jjm … … 42 44 ENDDO 43 45 ENDDO 44 call dump2d(jj p1,llm,um,'Vent-u geostrophique')46 call dump2d(jjm,llm,um,'Vent-u geostrophique') 45 47 46 48 c -
LMDZ4/trunk/libf/dyn3d/write_paramLMDZ_dyn.h
r956 r1279 107 107 . zx_tmp_2d,iip1*jjp1,ndex2d) 108 108 c 109 IF(true_calendar) THEN 110 zx_tmp_2d(1:iip1,1:jjp1)=1. 111 ELSE 112 zx_tmp_2d(1:iip1,1:jjp1)=0. 113 ENDIF 109 if (calend == 'earth_360d') then 110 zx_tmp_2d(1:iip1,1:jjp1)=1. 111 else if (calend == 'earth_365d') then 112 zx_tmp_2d(1:iip1,1:jjp1)=2. 113 else if (calend == 'earth_366d') then 114 zx_tmp_2d(1:iip1,1:jjp1)=3. 115 endif 116 114 117 CALL histwrite(nid_ctesGCM, "true_calendar", itau_w, 115 118 . zx_tmp_2d,iip1*jjp1,ndex2d)
Note: See TracChangeset
for help on using the changeset viewer.