Changeset 5117 for LMDZ6/branches/Amaury_dev/libf/dyn3d
- Timestamp:
- Jul 24, 2024, 4:23:34 PM (4 months ago)
- Location:
- LMDZ6/branches/Amaury_dev/libf/dyn3d
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/dyn3d/abort_gcm.F90
r5116 r5117 7 7 USE IOIPSL 8 8 !! ug Pour les sorties XIOS 9 USE wxios9 USE lmdz_wxios 10 10 11 11 include "iniprint.h" … … 19 19 ! ierr = severity of situation ( = 0 normal ) 20 20 21 CHARACTER(LEN = *), intent(in) :: modname22 integer, intent(in) :: ierr23 CHARACTER(LEN = *), intent(in) :: message21 CHARACTER(LEN = *), INTENT(IN) :: modname 22 INTEGER, INTENT(IN) :: ierr 23 CHARACTER(LEN = *), INTENT(IN) :: message 24 24 25 25 WRITE(lunout, *) 'in abort_gcm' … … 35 35 WRITE(lunout, *) 'Stopping in ', modname 36 36 WRITE(lunout, *) 'Reason = ', message 37 if(ierr == 0) THEN37 IF (ierr == 0) THEN 38 38 WRITE(lunout, *) 'Everything is cool' 39 39 stop … … 41 41 WRITE(lunout, *) 'Houston, we have a problem, ierr = ', ierr 42 42 stop 1 43 endif43 ENDIF 44 44 END SUBROUTINE abort_gcm -
LMDZ6/branches/Amaury_dev/libf/dyn3d/addfi.F90
r5116 r5117 119 119 ENDDO 120 120 121 if(planet_type=="earth") THEN121 IF (planet_type=="earth") THEN 122 122 ! earth case, special treatment for first 2 tracers (water) 123 123 DO iq = 1, 2 … … 148 148 ENDDO 149 149 ENDDO 150 endif! of if (planet_type=="earth")150 ENDIF ! of if (planet_type=="earth") 151 151 152 152 DO ij = 1, iim -
LMDZ6/branches/Amaury_dev/libf/dyn3d/advtrac.f90
r5116 r5117 13 13 USE comconst_mod, ONLY: dtvr 14 14 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_DEBUGIO 15 USE strings_mod, ONLY: int2str15 USE lmdz_strings, ONLY: int2str 16 16 USE lmdz_description, ONLY: descript 17 17 USE lmdz_libmath, ONLY: minmax -
LMDZ6/branches/Amaury_dev/libf/dyn3d/bilan_dyn.F90
r5116 r5117 52 52 53 53 INTEGER :: icum, ncum 54 logical:: first54 LOGICAL :: first 55 55 REAL :: zz, zqy, zfactv(jjm, llm) 56 56 … … 169 169 ndex3d = 0 170 170 171 if(first) THEN171 IF (first) THEN 172 172 icum = 0 173 173 ! initialisation des fichiers … … 175 175 ! ncum est la frequence de stokage en pas de temps 176 176 ncum = dt_cum / dt_app 177 if(abs(ncum * dt_app - dt_cum)>1.e-5 * dt_app) THEN177 IF (abs(ncum * dt_app - dt_cum)>1.e-5 * dt_app) THEN 178 178 WRITE(lunout, *) & 179 179 'Pb : le pas de cumule doit etre multiple du pas' … … 183 183 endif 184 184 185 if(i_sortie==1) THEN185 IF (i_sortie==1) THEN 186 186 file = 'dynzon' 187 187 CALL inigrads(ifile, 1 & … … 295 295 CALL histend(fileid) 296 296 297 endif297 ENDIF 298 298 299 299 … … 334 334 flux_vQ_cum = 0. 335 335 flux_uQ_cum = 0. 336 endif336 ENDIF 337 337 338 338 IF (prt_level > 5) & … … 407 407 ! PAS DE TEMPS D'ECRITURE 408 408 !===================================================================== 409 if(icum==ncum) THEN409 IF (icum==ncum) THEN 410 410 !===================================================================== 411 411 … … 528 528 ! PRINT*,'4OK' 529 529 ! sorties proprement dites 530 if(i_sortie==1) THEN530 IF (i_sortie==1) THEN 531 531 do iQ = 1, nQ 532 532 do itr = 1, ntr … … 573 573 !///////////////////////////////////////////////////////////////////// 574 574 icum = 0 !/////////////////////////////////////// 575 endif ! icum.eq.ncum !///////////////////////////////////////575 ENDIF ! icum.EQ.ncum !/////////////////////////////////////// 576 576 !///////////////////////////////////////////////////////////////////// 577 577 !===================================================================== -
LMDZ6/branches/Amaury_dev/libf/dyn3d/caladvtrac.F90
r5116 r5117 50 50 ! 51 51 ! Earth-specific stuff for the first 2 tracers (water) 52 if(planet_type=="earth") THEN52 IF (planet_type=="earth") THEN 53 53 ! initialisation 54 54 ! CRisi: il faut gérer tous les traceurs si on veut pouvoir faire des … … 60 60 !c CALL minmaxq(q(1,1,1),1.e33,-1.e33,'Eau vapeur (a) ') 61 61 !c CALL minmaxq(q(1,1,2),1.e33,-1.e33,'Eau liquide(a) ') 62 endif ! of if (planet_type.eq."earth")62 ENDIF ! of if (planet_type.EQ."earth") 63 63 ! advection 64 64 … … 70 70 71 71 IF(iapptrac==iapp_tracvl) THEN 72 if(planet_type=="earth") THEN72 IF (planet_type=="earth") THEN 73 73 ! Earth-specific treatment for the first 2 tracers (water) 74 74 ! … … 105 105 ENDDO 106 106 ! 107 endif ! of if (planet_type. eq."earth")107 endif ! of if (planet_type.EQ."earth") 108 108 ELSE 109 if(planet_type=="earth") THEN109 IF (planet_type=="earth") THEN 110 110 ! Earth-specific treatment for the first 2 tracers (water) 111 111 dq(:, :, 1:nqtot) = 0. 112 endif ! of if (planet_type. eq."earth")112 endif ! of if (planet_type.EQ."earth") 113 113 ENDIF ! of IF( iapptrac.EQ.iapp_tracvl ) 114 114 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/check_isotopes.F90
r5116 r5117 1 1 SUBROUTINE check_isotopes_seq(q, ip1jmp1, err_msg) 2 USE strings_mod, ONLY: maxlen, msg, strIdx, strStack, int2str, real2str2 USE lmdz_strings, ONLY: maxlen, msg, strIdx, strStack, int2str, real2str 3 3 USE infotrac, ONLY: nqtot, niso, nphas, isotope, isoCheck, iqIsoPha, isoSelect, & 4 4 ntiso, iH2O, nzone, tracers, isoName, itZonIso, getKey … … 35 35 iso_O17 = strIdx(isoName,'H217O') 36 36 iso_HTO = strIdx(isoName,'HTO') 37 if(tnat1) THEN37 IF (tnat1) THEN 38 38 tnat(:)=1.0 39 39 else -
LMDZ6/branches/Amaury_dev/libf/dyn3d/conf_gcm.f90
r5116 r5117 4 4 5 5 USE control_mod 6 useIOIPSL6 USE IOIPSL 7 7 USE infotrac, ONLY: type_trac 8 uselmdz_assert, ONLY: assert8 USE lmdz_assert, ONLY: assert 9 9 USE comconst_mod, ONLY: dissip_deltaz, dissip_factz, dissip_zref, & 10 10 iflag_top_bound, mode_top_bound, tau_top_bound, & … … 79 79 lunout = 6 80 80 CALL getin('lunout', lunout) 81 IF (lunout /= 5 . and. lunout /= 6) THEN81 IF (lunout /= 5 .AND. lunout /= 6) THEN 82 82 OPEN(UNIT = lunout, FILE = 'lmdz.out', ACTION = 'write', & 83 83 STATUS = 'unknown', FORM = 'formatted') … … 308 308 maxlatfilter = -1.0 309 309 CALL getin('maxlatfilter', maxlatfilter) 310 if(maxlatfilter > 90) &310 IF (maxlatfilter > 90) & 311 311 CALL abort_gcm("conf_gcm", 'maxlatfilter should be <=90', 1) 312 312 … … 322 322 iflag_top_bound = 1 323 323 CALL getin('iflag_top_bound', iflag_top_bound) 324 IF (iflag_top_bound < 0 . or. iflag_top_bound > 2) &324 IF (iflag_top_bound < 0 .OR. iflag_top_bound > 2) & 325 325 CALL abort_gcm("conf_gcm", 'iflag_top_bound must be 0, 1 or 2', 1) 326 326 … … 396 396 ! ......... ( modif le 17/04/96 ) ......... 397 397 398 test_etatinit: IF (. not. etatinit) THEN398 test_etatinit: IF (.NOT. etatinit) THEN 399 399 !Config Key = clon 400 400 !Config Desc = centre du zoom, longitude … … 828 828 CALL getin('ok_strato', ok_strato) 829 829 830 vert_prof_dissip = merge(1, 0, ok_strato . and. llm==39)830 vert_prof_dissip = merge(1, 0, ok_strato .AND. llm==39) 831 831 CALL getin('vert_prof_dissip', vert_prof_dissip) 832 CALL assert(vert_prof_dissip == 0 . or. vert_prof_dissip == 1, &832 CALL assert(vert_prof_dissip == 0 .OR. vert_prof_dissip == 1, & 833 833 "bad value for vert_prof_dissip") 834 834 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/dynetat0.F90
r5116 r5117 7 7 !------------------------------------------------------------------------------- 8 8 USE infotrac, ONLY: nqtot, tracers, niso, iqIsoPha, iH2O, isoName 9 USE strings_mod, ONLY: maxlen, msg, strStack, real2str, int2str9 USE lmdz_strings, ONLY: maxlen, msg, strStack, real2str, int2str 10 10 USE netcdf, ONLY: nf90_open, nf90_nowrite, nf90_inq_varid, & 11 11 nf90_close, nf90_get_var, nf90_noerr 12 USE readTracFiles_mod, ONLY: new2oldH2O, newHNO3, oldHNO3, getKey12 USE lmdz_readTracFiles, ONLY: new2oldH2O, newHNO3, oldHNO3, getKey 13 13 USE control_mod, ONLY: planet_type 14 14 USE lmdz_assert_eq, ONLY: assert_eq … … 157 157 iqParent = tracers(iq)%iqParent 158 158 IF(tracers(iq)%iso_iZone == 0) THEN 159 if(tnat1) THEN159 IF (tnat1) THEN 160 160 tnat=1.0 161 161 alpha_ideal=1.0 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/dynredem.F90
r5114 r5117 5 5 !------------------------------------------------------------------------------- 6 6 USE IOIPSL 7 USE strings_mod, ONLY: maxlen7 USE lmdz_strings, ONLY: maxlen 8 8 USE infotrac, ONLY: nqtot, tracers 9 9 USE netcdf, ONLY: nf90_create, nf90_def_dim, nf90_inq_varid, nf90_global, & … … 157 157 ! Purpose: Write the NetCDF restart file (append). 158 158 !------------------------------------------------------------------------------- 159 USE strings_mod, ONLY: maxlen159 USE lmdz_strings, ONLY: maxlen 160 160 USE infotrac, ONLY: nqtot, tracers, type_trac 161 161 USE control_mod -
LMDZ6/branches/Amaury_dev/libf/dyn3d/fluxstokenc.F90
r5116 r5117 41 41 SAVE iadvtr, massem, pbaruc, pbarvc, irec 42 42 SAVE phic, tetac 43 logical:: first43 LOGICAL :: first 44 44 save first 45 45 data first/.TRUE./ … … 72 72 first = .FALSE. 73 73 74 endif74 ENDIF 75 75 76 76 IF(iadvtr==0) THEN -
LMDZ6/branches/Amaury_dev/libf/dyn3d/friction.F90
r5116 r5117 28 28 29 29 ! arguments: 30 REAL, INTENT( out) :: ucov(iip1, jjp1, llm)31 REAL, INTENT( out) :: vcov(iip1, jjm, llm)32 REAL, INTENT( in) :: pdt ! time step30 REAL, INTENT(OUT) :: ucov(iip1, jjp1, llm) 31 REAL, INTENT(OUT) :: vcov(iip1, jjm, llm) 32 REAL, INTENT(IN) :: pdt ! time step 33 33 34 34 ! local variables: … … 47 47 ! set friction type 48 48 CALL getin("friction_type", friction_type) 49 if ((friction_type<0).or.(friction_type>1)) THEN49 IF ((friction_type<0).OR.(friction_type>1)) THEN 50 50 abort_message = "wrong friction type" 51 51 WRITE(lunout, *)'Friction: wrong friction type', friction_type … … 55 55 ENDIF 56 56 57 if(friction_type==0) THEN57 IF (friction_type==0) THEN 58 58 ! calcul des composantes au carre du vent naturel 59 59 do j = 1, jjp1 … … 116 116 vcov(iip1, j, 1) = vcov(1, j, 1) 117 117 enddo 118 endif ! of if (friction_type.eq.0)118 ENDIF ! of if (friction_type.EQ.0) 119 119 120 if(friction_type==1) THEN120 IF (friction_type==1) THEN 121 121 do l = 1, llm 122 122 ucov(:, :, l) = ucov(:, :, l) * (1. - pdt * kfrict(l)) 123 123 vcov(:, :, l) = vcov(:, :, l) * (1. - pdt * kfrict(l)) 124 124 enddo 125 endif125 ENDIF 126 126 127 127 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/gcm.F90
r5116 r5117 7 7 8 8 USE IOIPSL 9 USE wxios ! ug Pour les sorties XIOS9 USE lmdz_wxios ! ug Pour les sorties XIOS 10 10 11 11 USE lmdz_filtreg, ONLY: inifilr … … 91 91 92 92 93 realtime_step, t_wrt, t_ops93 REAL time_step, t_wrt, t_ops 94 94 95 95 ! LOGICAL call_iniphys … … 108 108 109 109 110 character (len=80) :: dynhist_file, dynhistave_file111 character (len=20) :: modname112 character (len=80) :: abort_message110 CHARACTER (LEN=80) :: dynhist_file, dynhistave_file 111 CHARACTER (LEN=20) :: modname 112 CHARACTER (LEN=80) :: abort_message 113 113 ! locales pour gestion du temps 114 114 INTEGER :: an, mois, jour 115 115 REAL :: heure 116 logicaluse_filtre_fft116 LOGICAL use_filtre_fft 117 117 118 118 !----------------------------------------------------------------------- … … 135 135 CALL conf_gcm( 99, .TRUE.) 136 136 137 if(mod(iphysiq, iperiod) /= 0) CALL abort_gcm("conf_gcm", &137 IF (mod(iphysiq, iperiod) /= 0) CALL abort_gcm("conf_gcm", & 138 138 "iphysiq must be a multiple of iperiod", 1) 139 139 … … 167 167 ! calend = 'earth_365d' 168 168 169 if(calend == 'earth_360d') THEN169 IF (calend == 'earth_360d') THEN 170 170 CALL ioconf_calendar('360_day') 171 171 WRITE(lunout,*)'CALENDRIER CHOISI: Terrestre a 360 jours/an' 172 else if(calend == 'earth_365d') THEN172 ELSE IF (calend == 'earth_365d') THEN 173 173 CALL ioconf_calendar('noleap') 174 174 WRITE(lunout,*)'CALENDRIER CHOISI: Terrestre a 365 jours/an' 175 else if(calend == 'gregorian') THEN175 ELSE IF (calend == 'gregorian') THEN 176 176 CALL ioconf_calendar('gregorian') 177 177 WRITE(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile' … … 179 179 abort_message = 'Mauvais choix de calendrier' 180 180 CALL abort_gcm(modname,abort_message,1) 181 endif181 ENDIF 182 182 !----------------------------------------------------------------------- 183 183 … … 203 203 204 204 ! lecture du fichier start.nc 205 if(read_start) THEN205 IF (read_start) THEN 206 206 ! we still need to run iniacademic to initialize some 207 207 ! constants & fields, if we run the 'newtonian' or 'SW' cases: 208 if(iflag_phys/=1) THEN208 IF (iflag_phys/=1) THEN 209 209 CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) 210 210 endif 211 211 212 ! if (planet_type. eq."earth") THEN212 ! if (planet_type.EQ."earth") THEN 213 213 ! Load an Earth-format start file 214 214 CALL dynetat0("start.nc",vcov,ucov, & 215 215 teta,q,masse,ps,phis, time_0) 216 ! endif ! of if (planet_type. eq."earth")216 ! endif ! of if (planet_type.EQ."earth") 217 217 218 218 ! WRITE(73,*) 'ucov',ucov … … 222 222 ! WRITE(77,*) 'q',q 223 223 224 endif! of if (read_start)224 ENDIF ! of if (read_start) 225 225 226 226 … … 228 228 IF (prt_level > 9) WRITE(lunout,*) & 229 229 'GCM: AVANT iniacademic AVANT AVANT AVANT AVANT' 230 if (.not.read_start) THEN230 IF (.NOT.read_start) THEN 231 231 start_time=0. 232 232 annee_ref=anneeref 233 233 CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) 234 endif234 ENDIF 235 235 236 236 … … 279 279 WRITE(lunout,*) & 280 280 'GCM: On reinitialise a la date lue dans gcm.def' 281 ELSE IF (annee_ref /= anneeref . or. day_ref /= dayref) THEN281 ELSE IF (annee_ref /= anneeref .OR. day_ref /= dayref) THEN 282 282 WRITE(lunout,*) & 283 283 'GCM: Attention les dates initiales lues dans le fichier' … … 290 290 ENDIF 291 291 292 ! if (annee_ref . ne. anneeref .or. day_ref .ne. dayref) THEN292 ! if (annee_ref .NE. anneeref .OR. day_ref .NE. dayref) THEN 293 293 ! WRITE(lunout,*) 294 294 ! . 'GCM: Attention les dates initiales lues dans le fichier' … … 298 298 ! WRITE(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref 299 299 ! WRITE(lunout,*)' day_ref=',day_ref," dayref=",dayref 300 ! if (raz_date . ne. 1) THEN300 ! if (raz_date .NE. 1) THEN 301 301 ! WRITE(lunout,*) 302 302 ! . 'GCM: On garde les dates du fichier restart' … … 331 331 332 332 333 if(iflag_phys==1) THEN333 IF (iflag_phys==1) THEN 334 334 ! these initialisations have already been done (via iniacademic) 335 335 ! if running in SW or Newtonian mode … … 349 349 ! -------------------------- 350 350 CALL inifilr 351 endif ! of if (iflag_phys.eq.1)351 ENDIF ! of if (iflag_phys.EQ.1) 352 352 353 353 !----------------------------------------------------------------------- … … 365 365 366 366 367 if(nday>=0) THEN367 IF (nday>=0) THEN 368 368 day_end = day_ini + nday 369 369 else 370 370 day_end = day_ini - nday/day_step 371 endif371 ENDIF 372 372 WRITE(lunout,300)day_ini,day_end 373 373 300 FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//) … … 384 384 ! ------------------------------- 385 385 386 IF ((iflag_phys==1). or.(iflag_phys>=100)) THEN386 IF ((iflag_phys==1).OR.(iflag_phys>=100)) THEN 387 387 ! Physics: 388 388 IF (CPPKEY_PHYS) THEN … … 393 393 iflag_phys) 394 394 END IF 395 ENDIF ! of IF ((iflag_phys==1). or.(iflag_phys>=100))396 397 ! if (planet_type. eq."earth") THEN395 ENDIF ! of IF ((iflag_phys==1).OR.(iflag_phys>=100)) 396 397 ! if (planet_type.EQ."earth") THEN 398 398 ! Write an Earth-format restart file 399 399 … … 404 404 405 405 time_step = zdtvr 406 if(ok_dyn_ins) THEN406 IF (ok_dyn_ins) THEN 407 407 ! initialize output file for instantaneous outputs 408 408 ! t_ops = iecri * daysec ! do operations every t_ops … … 411 411 CALL inithist(day_ref,annee_ref,time_step, & 412 412 t_ops,t_wrt) 413 endif413 ENDIF 414 414 415 415 IF (ok_dyn_ave) THEN -
LMDZ6/branches/Amaury_dev/libf/dyn3d/groupe.F90
r5116 r5117 3 3 SUBROUTINE groupe(pext, pbaru, pbarv, pbarum, pbarvm, wm) 4 4 5 usecomconst_mod, ONLY: ngroup5 USE comconst_mod, ONLY: ngroup 6 6 7 7 IMPLICIT NONE … … 37 37 INTEGER :: i, j, l 38 38 39 logical:: firstcall, groupe_ok39 LOGICAL :: firstcall, groupe_ok 40 40 save firstcall, groupe_ok 41 41 … … 43 43 data groupe_ok/.TRUE./ 44 44 45 if(iim==1) THEN45 IF (iim==1) THEN 46 46 groupe_ok = .FALSE. 47 endif47 ENDIF 48 48 49 if(firstcall) THEN50 if(groupe_ok) THEN49 IF (firstcall) THEN 50 IF (groupe_ok) THEN 51 51 IF(mod(iim, 2**ngroup)/=0) & 52 52 CALL abort_gcm('groupe', 'probleme du nombre de point', 1) 53 53 endif 54 54 firstcall = .FALSE. 55 endif55 ENDIF 56 56 57 57 … … 63 63 CALL scopy(ijmllm, pbarv, 1, pbarvm, 1) 64 64 65 if(groupe_ok) THEN65 IF (groupe_ok) THEN 66 66 CALL groupeun(jjp1, llm, zconvmm) 67 67 CALL groupeun(jjm, llm, pbarvm) … … 84 84 pbarum(:, :, :) = pbaru(:, :, :) 85 85 pbarvm(:, :, :) = pbarv(:, :, :) 86 endif86 ENDIF 87 87 88 88 ! integration de la convergence de masse de haut en bas ...... -
LMDZ6/branches/Amaury_dev/libf/dyn3d/guide_mod.F90
r5116 r5117 10 10 11 11 USE getparam, ONLY: ini_getparam, fin_getparam, getpar 12 USE Write_Field12 USE lmdz_write_field 13 13 USE netcdf, ONLY: nf90_nowrite, nf90_open, nf90_inq_varid, nf90_close, & 14 14 nf90_inq_dimid, nf90_inquire_dimension, nf90_float, nf90_def_var, & … … 16 16 nf90_close, nf90_inq_varid, nf90_get_var, nf90_noerr, nf90_clobber, & 17 17 nf90_64bit_offset, nf90_inq_dimid, nf90_inquire_dimension, nf90_put_var 18 USE pres2lev_mod, ONLY: pres2lev18 USE lmdz_pres2lev, ONLY: pres2lev 19 19 20 20 IMPLICIT NONE … … 72 72 SUBROUTINE guide_init 73 73 74 usenetcdf, ONLY: nf90_noerr74 USE netcdf, ONLY: nf90_noerr 75 75 USE control_mod, ONLY: day_step 76 76 USE serre_mod, ONLY: grossismx … … 101 101 CALL getpar('guide_add',.FALSE.,guide_add,'forçage constant?') 102 102 CALL getpar('guide_zon',.FALSE.,guide_zon,'guidage moy zonale') 103 if (guide_zon .and. abs(grossismx - 1.) > 0.01) &103 IF (guide_zon .AND. abs(grossismx - 1.) > 0.01) & 104 104 CALL abort_gcm("guide_init", & 105 105 "zonal nudging requires grid regular in longitude", 1) … … 173 173 ! --------------------------------------------- 174 174 ncidpl=-99 175 if(guide_plevs==1) THEN176 if(ncidpl==-99) THEN175 IF (guide_plevs==1) THEN 176 IF (ncidpl==-99) THEN 177 177 rcod=nf90_open('apbp.nc',nf90_nowrite, ncidpl) 178 if(rcod/=nf90_noerr) THEN178 IF (rcod/=nf90_noerr) THEN 179 179 abort_message=' Nudging error -> no file apbp.nc' 180 180 CALL abort_gcm(modname,abort_message,1) … … 182 182 endif 183 183 elseif (guide_plevs==2) THEN 184 if(ncidpl==-99) THEN184 IF (ncidpl==-99) THEN 185 185 rcod=nf90_open('P.nc',nf90_nowrite,ncidpl) 186 if(rcod/=nf90_noerr) THEN186 IF (rcod/=nf90_noerr) THEN 187 187 abort_message=' Nudging error -> no file P.nc' 188 188 CALL abort_gcm(modname,abort_message,1) … … 191 191 192 192 elseif (guide_u) THEN 193 if(ncidpl==-99) THEN193 IF (ncidpl==-99) THEN 194 194 rcod=nf90_open('u.nc',nf90_nowrite,ncidpl) 195 if(rcod/=nf90_noerr) THEN195 IF (rcod/=nf90_noerr) THEN 196 196 CALL abort_gcm(modname, & 197 197 ' Nudging error -> no file u.nc',1) … … 200 200 201 201 elseif (guide_v) THEN 202 if(ncidpl==-99) THEN202 IF (ncidpl==-99) THEN 203 203 rcod=nf90_open('v.nc',nf90_nowrite,ncidpl) 204 if(rcod/=nf90_noerr) THEN204 IF (rcod/=nf90_noerr) THEN 205 205 CALL abort_gcm(modname, & 206 206 ' Nudging error -> no file v.nc',1) … … 208 208 endif 209 209 elseif (guide_T) THEN 210 if(ncidpl==-99) THEN210 IF (ncidpl==-99) THEN 211 211 rcod=nf90_open('T.nc',nf90_nowrite,ncidpl) 212 if(rcod/=nf90_noerr) THEN212 IF (rcod/=nf90_noerr) THEN 213 213 CALL abort_gcm(modname, & 214 214 ' Nudging error -> no file T.nc',1) … … 216 216 endif 217 217 elseif (guide_Q) THEN 218 if(ncidpl==-99) THEN218 IF (ncidpl==-99) THEN 219 219 rcod=nf90_open('hur.nc',nf90_nowrite, ncidpl) 220 if(rcod/=nf90_noerr) THEN220 IF (rcod/=nf90_noerr) THEN 221 221 CALL abort_gcm(modname, & 222 222 ' Nudging error -> no file hur.nc',1) … … 406 406 CALL tau2alpha(1,iip1,jjp1,factt,tau_min_Q,tau_max_Q,alpha_Q) 407 407 ! correction de rappel dans couche limite 408 if(guide_BL) THEN408 IF (guide_BL) THEN 409 409 alpha_pcor(:)=1. 410 410 else … … 502 502 ! compute pressures at layer interfaces 503 503 CALL pression(ip1jmp1,ap,bp,ps,p) 504 if(pressure_exner) THEN504 IF (pressure_exner) THEN 505 505 CALL exner_hyb(ip1jmp1,ps,p,pks,pk) 506 506 else … … 515 515 ENDIF 516 516 517 if(guide_u) THEN518 if(guide_add) THEN517 IF (guide_u) THEN 518 IF (guide_add) THEN 519 519 f_add=(1.-tau)*ugui1+tau*ugui2 520 520 else 521 521 f_add=(1.-tau)*ugui1+tau*ugui2-ucov 522 522 endif 523 if(guide_zon) CALL guide_zonave(1,jjp1,llm,f_add)523 IF (guide_zon) CALL guide_zonave(1,jjp1,llm,f_add) 524 524 CALL guide_addfield(ip1jmp1,llm,f_add,alpha_u) 525 525 IF (f_out) CALL guide_out("ua",jjp1,llm,(1.-tau)*ugui1+tau*ugui2) … … 529 529 endif 530 530 531 if(guide_T) THEN532 if(guide_add) THEN531 IF (guide_T) THEN 532 IF (guide_add) THEN 533 533 f_add=(1.-tau)*tgui1+tau*tgui2 534 534 else 535 535 f_add=(1.-tau)*tgui1+tau*tgui2-teta 536 536 endif 537 if(guide_zon) CALL guide_zonave(2,jjp1,llm,f_add)537 IF (guide_zon) CALL guide_zonave(2,jjp1,llm,f_add) 538 538 CALL guide_addfield(ip1jmp1,llm,f_add,alpha_T) 539 539 IF (f_out) CALL guide_out("teta",jjp1,llm,f_add/factt) … … 541 541 endif 542 542 543 if(guide_P) THEN544 if(guide_add) THEN543 IF (guide_P) THEN 544 IF (guide_add) THEN 545 545 f_add(1:ip1jmp1,1)=(1.-tau)*psgui1+tau*psgui2 546 546 else 547 547 f_add(1:ip1jmp1,1)=(1.-tau)*psgui1+tau*psgui2-ps 548 548 endif 549 if(guide_zon) CALL guide_zonave(2,jjp1,1,f_add(1:ip1jmp1,1))549 IF (guide_zon) CALL guide_zonave(2,jjp1,1,f_add(1:ip1jmp1,1)) 550 550 CALL guide_addfield(ip1jmp1,1,f_add(1:ip1jmp1,1),alpha_P) 551 551 ! IF (f_out) CALL guide_out("ps",jjp1,1,f_add(1:ip1jmp1,1)/factt) … … 555 555 endif 556 556 557 if(guide_Q) THEN558 if(guide_add) THEN557 IF (guide_Q) THEN 558 IF (guide_add) THEN 559 559 f_add=(1.-tau)*qgui1+tau*qgui2 560 560 else 561 561 f_add=(1.-tau)*qgui1+tau*qgui2-q 562 562 endif 563 if(guide_zon) CALL guide_zonave(2,jjp1,llm,f_add)563 IF (guide_zon) CALL guide_zonave(2,jjp1,llm,f_add) 564 564 CALL guide_addfield(ip1jmp1,llm,f_add,alpha_Q) 565 565 IF (f_out) CALL guide_out("q",jjp1,llm,f_add/factt) … … 567 567 endif 568 568 569 if(guide_v) THEN570 if(guide_add) THEN569 IF (guide_v) THEN 570 IF (guide_add) THEN 571 571 f_add(1:ip1jm,:)=(1.-tau)*vgui1+tau*vgui2 572 572 else 573 573 f_add(1:ip1jm,:)=(1.-tau)*vgui1+tau*vgui2-vcov 574 574 endif 575 if(guide_zon) CALL guide_zonave(2,jjm,llm,f_add(1:ip1jm,:))575 IF (guide_zon) CALL guide_zonave(2,jjm,llm,f_add(1:ip1jm,:)) 576 576 CALL guide_addfield(ip1jm,llm,f_add(1:ip1jm,:),alpha_v) 577 577 IF (f_out) CALL guide_out("v",jjm,llm,vcov) … … 670 670 SUBROUTINE guide_interp(psi,teta) 671 671 672 use exner_hyb_m, ONLY: exner_hyb 673 use exner_milieu_m, ONLY: exner_milieu 674 use comconst_mod, ONLY: kappa, cpp 675 use comvert_mod, ONLY: preff, pressure_exner, bp, ap 672 USE exner_hyb_m, ONLY: exner_hyb 673 USE exner_milieu_m, ONLY: exner_milieu 674 USE comconst_mod, ONLY: kappa, cpp 675 USE comvert_mod, ONLY: preff, pressure_exner, bp, ap 676 USE lmdz_q_sat, ONLY: q_sat 676 677 IMPLICIT NONE 677 678 … … 729 730 730 731 END IF 731 if(first) THEN732 IF (first) THEN 732 733 first=.FALSE. 733 734 WRITE(*,*)trim(modname)//' : check vertical level order' … … 742 743 enddo 743 744 WRITE(*,*)trim(modname)//' invert ordering: invert_p=',invert_p 744 if(guide_u) THEN745 IF (guide_u) THEN 745 746 do l=1,nlevnc 746 747 WRITE(*,*)trim(modname)//' U(',l,')=',unat2(1,1,l) 747 748 enddo 748 749 endif 749 if(guide_T) THEN750 IF (guide_T) THEN 750 751 do l=1,nlevnc 751 752 WRITE(*,*)trim(modname)//' T(',l,')=',tnat2(1,1,l) … … 758 759 ! ----------------------------------------------------------------- 759 760 CALL pression( ip1jmp1, ap, bp, psi, p ) 760 if(pressure_exner) THEN761 IF (pressure_exner) THEN 761 762 CALL exner_hyb(ip1jmp1,psi,p,pks,pk) 762 763 else … … 803 804 ! Conversion en variables gcm (ucov, vcov...) 804 805 ! ----------------------------------------------------------------- 805 if(guide_P) THEN806 IF (guide_P) THEN 806 807 do j=1,jjp1 807 808 do i=1,iim … … 921 922 ! Calcul des constantes de rappel alpha (=1/tau) 922 923 923 usecomconst_mod, ONLY: pi924 useserre_mod, ONLY: clon, clat, grossismx, grossismy924 USE comconst_mod, ONLY: pi 925 USE serre_mod, ONLY: clon, clat, grossismx, grossismy 925 926 926 927 IMPLICIT NONE … … 944 945 REAL, DIMENSION (iip1,jjp1) :: dxdys,dxdyu 945 946 REAL, DIMENSION (iip1,jjm) :: dxdyv 946 realdxdy_947 realzlat,zlon948 realalphamin,alphamax,xi949 integeri,j,ilon,ilat947 REAL dxdy_ 948 REAL zlat,zlon 949 REAL alphamin,alphamax,xi 950 INTEGER i,j,ilon,ilat 950 951 CHARACTER(LEN=20),parameter :: modname="tau2alpha" 951 952 CHARACTER (len = 80) :: abort_message … … 962 963 do j=1,pjm 963 964 do i=1,pim 964 if(typ==2) THEN965 IF (typ==2) THEN 965 966 zlat=rlatu(j)*180./pi 966 967 zlon=rlonu(i)*180./pi … … 1037 1038 enddo 1038 1039 ! Calcul de gamma 1039 if (abs(grossismx-1.)<0.1.or.abs(grossismy-1.)<0.1) THEN1040 IF (abs(grossismx-1.)<0.1.OR.abs(grossismy-1.)<0.1) THEN 1040 1041 WRITE(*,*)trim(modname)//' ATTENTION modele peu zoome' 1041 1042 WRITE(*,*)trim(modname)//' ATTENTION on prend une constante de guidage cste' … … 1044 1045 gamma=(dxdy_max-2.*dxdy_min)/(dxdy_max-dxdy_min) 1045 1046 WRITE(*,*)trim(modname)//' gamma=',gamma 1046 if(gamma<1.e-5) THEN1047 IF (gamma<1.e-5) THEN 1047 1048 WRITE(*,*)trim(modname)//' gamma =',gamma,'<1e-5' 1048 1049 abort_message='stopped' … … 1050 1051 endif 1051 1052 gamma=log(0.5)/log(gamma) 1052 if(gamma4) THEN1053 IF (gamma4) THEN 1053 1054 gamma=min(gamma,4.) 1054 1055 endif … … 1059 1060 do j=1,pjm 1060 1061 do i=1,pim 1061 if(typ==1) THEN1062 IF (typ==1) THEN 1062 1063 dxdy_=dxdys(i,j) 1063 1064 zlat=rlatu(j)*180./pi … … 1069 1070 zlat=rlatv(j)*180./pi 1070 1071 endif 1071 if (abs(grossismx-1.)<0.1.or.abs(grossismy-1.)<0.1) THEN1072 IF (abs(grossismx-1.)<0.1.OR.abs(grossismy-1.)<0.1) THEN 1072 1073 ! pour une grille reguliere, xi=xxx**0=1 -> alpha=alphamin 1073 1074 alpha(i,j)=alphamin … … 1075 1076 xi=((dxdy_max-dxdy_)/(dxdy_max-dxdy_min))**gamma 1076 1077 xi=min(xi,1.) 1077 IF(lat_min_g<=zlat . and. zlat<=lat_max_g) THEN1078 IF(lat_min_g<=zlat .AND. zlat<=lat_max_g) THEN 1078 1079 alpha(i,j)=xi*alphamin+(1.-xi)*alphamax 1079 1080 else … … 1085 1086 ENDIF ! guide_reg 1086 1087 1087 if (.not. guide_add) alpha = 1. - exp(- alpha)1088 IF (.NOT. guide_add) alpha = 1. - exp(- alpha) 1088 1089 1089 1090 END SUBROUTINE tau2alpha … … 1113 1114 ! Premier appel: initialisation de la lecture des fichiers 1114 1115 ! ----------------------------------------------------------------- 1115 if(first) THEN1116 IF (first) THEN 1116 1117 ncidpl=-99 1117 1118 WRITE(*,*) trim(modname)//': opening nudging files ' 1118 1119 ! Niveaux de pression si non constants 1119 if(guide_plevs==1) THEN1120 IF (guide_plevs==1) THEN 1120 1121 WRITE(*,*) trim(modname)//' Reading nudging on model levels' 1121 1122 rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl) … … 1138 1139 1139 1140 ! Pression si guidage sur niveaux P variables 1140 if(guide_plevs==2) THEN1141 IF (guide_plevs==2) THEN 1141 1142 rcode = nf90_open('P.nc', nf90_nowrite, ncidp) 1142 1143 IF (rcode/=nf90_noerr) THEN … … 1150 1151 ENDIF 1151 1152 WRITE(*,*) trim(modname)//' ncidp,varidp',ncidp,varidp 1152 if(ncidpl==-99) ncidpl=ncidp1153 IF (ncidpl==-99) ncidpl=ncidp 1153 1154 endif 1154 1155 1155 1156 ! Vent zonal 1156 if(guide_u) THEN1157 IF (guide_u) THEN 1157 1158 rcode = nf90_open('u.nc', nf90_nowrite, ncidu) 1158 1159 IF (rcode/=nf90_noerr) THEN … … 1166 1167 ENDIF 1167 1168 WRITE(*,*) trim(modname)//' ncidu,varidu',ncidu,varidu 1168 if(ncidpl==-99) ncidpl=ncidu1169 IF (ncidpl==-99) ncidpl=ncidu 1169 1170 1170 1171 status=nf90_inq_dimid(ncidu, "LONU", dimid) … … 1185 1186 1186 1187 ! Vent meridien 1187 if(guide_v) THEN1188 IF (guide_v) THEN 1188 1189 rcode = nf90_open('v.nc', nf90_nowrite, ncidv) 1189 1190 IF (rcode/=nf90_noerr) THEN … … 1197 1198 ENDIF 1198 1199 WRITE(*,*) trim(modname)//' ncidv,varidv',ncidv,varidv 1199 if(ncidpl==-99) ncidpl=ncidv1200 IF (ncidpl==-99) ncidpl=ncidv 1200 1201 1201 1202 status=nf90_inq_dimid(ncidv, "LONV", dimid) … … 1218 1219 1219 1220 ! Temperature 1220 if(guide_T) THEN1221 IF (guide_T) THEN 1221 1222 rcode = nf90_open('T.nc', nf90_nowrite, ncidt) 1222 1223 IF (rcode/=nf90_noerr) THEN … … 1230 1231 ENDIF 1231 1232 WRITE(*,*) trim(modname)//' ncidT,varidT',ncidt,varidt 1232 if(ncidpl==-99) ncidpl=ncidt1233 IF (ncidpl==-99) ncidpl=ncidt 1233 1234 1234 1235 status=nf90_inq_dimid(ncidt, "LONV", dimid) … … 1249 1250 1250 1251 ! Humidite 1251 if(guide_Q) THEN1252 IF (guide_Q) THEN 1252 1253 rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ) 1253 1254 IF (rcode/=nf90_noerr) THEN … … 1261 1262 ENDIF 1262 1263 WRITE(*,*) trim(modname)//' ncidQ,varidQ',ncidQ,varidQ 1263 if(ncidpl==-99) ncidpl=ncidQ1264 IF (ncidpl==-99) ncidpl=ncidQ 1264 1265 1265 1266 status=nf90_inq_dimid(ncidQ, "LONV", dimid) … … 1280 1281 1281 1282 ! Pression de surface 1282 if((guide_P).OR.(guide_modele)) THEN1283 IF ((guide_P).OR.(guide_modele)) THEN 1283 1284 rcode = nf90_open('ps.nc', nf90_nowrite, ncidps) 1284 1285 IF (rcode/=nf90_noerr) THEN … … 1294 1295 endif 1295 1296 ! Coordonnee verticale 1296 if(guide_plevs==0) THEN1297 IF (guide_plevs==0) THEN 1297 1298 rcode = nf90_inq_varid(ncidpl, 'LEVEL', varidpl) 1298 1299 IF (rcode/=0) rcode = nf90_inq_varid(ncidpl, 'PRESSURE', varidpl) … … 1300 1301 endif 1301 1302 ! Coefs ap, bp pour calcul de la pression aux differents niveaux 1302 if(guide_plevs==1) THEN1303 IF (guide_plevs==1) THEN 1303 1304 status=nf90_get_var(ncidpl,varidap,apnc,[1],[nlevnc]) 1304 1305 status=nf90_get_var(ncidpl,varidbp,bpnc,[1],[nlevnc]) … … 1328 1329 1329 1330 ! Pression 1330 if(guide_plevs==2) THEN1331 IF (guide_plevs==2) THEN 1331 1332 status=nf90_get_var(ncidp,varidp,pnat2,start,count) 1332 1333 IF (invert_y) THEN … … 1338 1339 1339 1340 ! Vent zonal 1340 if(guide_u) THEN1341 IF (guide_u) THEN 1341 1342 status=nf90_get_var(ncidu,varidu,unat2,start,count) 1342 1343 IF (invert_y) THEN … … 1346 1347 1347 1348 ! Temperature 1348 if(guide_T) THEN1349 IF (guide_T) THEN 1349 1350 status=nf90_get_var(ncidt,varidt,tnat2,start,count) 1350 1351 IF (invert_y) THEN … … 1354 1355 1355 1356 ! Humidite 1356 if(guide_Q) THEN1357 IF (guide_Q) THEN 1357 1358 status=nf90_get_var(ncidQ,varidQ,qnat2,start,count) 1358 1359 IF (invert_y) THEN … … 1363 1364 1364 1365 ! Vent meridien 1365 if(guide_v) THEN1366 IF (guide_v) THEN 1366 1367 count(2)=jjm 1367 1368 status=nf90_get_var(ncidv,varidv,vnat2,start,count) … … 1372 1373 1373 1374 ! Pression de surface 1374 if((guide_P).OR.(guide_modele)) THEN1375 IF ((guide_P).OR.(guide_modele)) THEN 1375 1376 start(3)=timestep 1376 1377 start(4)=0 … … 1413 1414 ! Premier appel: initialisation de la lecture des fichiers 1414 1415 ! ----------------------------------------------------------------- 1415 if(first) THEN1416 IF (first) THEN 1416 1417 ncidpl=-99 1417 1418 WRITE(*,*)trim(modname)//' : opening nudging files ' 1418 1419 ! Ap et Bp si niveaux de pression hybrides 1419 if(guide_plevs==1) THEN1420 IF (guide_plevs==1) THEN 1420 1421 WRITE(*,*)trim(modname)//' Reading nudging on model levels' 1421 1422 rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl) … … 1437 1438 endif 1438 1439 ! Pression 1439 if(guide_plevs==2) THEN1440 IF (guide_plevs==2) THEN 1440 1441 rcode = nf90_open('P.nc', nf90_nowrite, ncidp) 1441 1442 IF (rcode/=nf90_noerr) THEN … … 1449 1450 ENDIF 1450 1451 WRITE(*,*)trim(modname)//' ncidp,varidp',ncidp,varidp 1451 if(ncidpl==-99) ncidpl=ncidp1452 IF (ncidpl==-99) ncidpl=ncidp 1452 1453 endif 1453 1454 ! Vent zonal 1454 if(guide_u) THEN1455 IF (guide_u) THEN 1455 1456 rcode = nf90_open('u.nc', nf90_nowrite, ncidu) 1456 1457 IF (rcode/=nf90_noerr) THEN … … 1464 1465 ENDIF 1465 1466 WRITE(*,*)trim(modname)//' ncidu,varidu',ncidu,varidu 1466 if(ncidpl==-99) ncidpl=ncidu1467 IF (ncidpl==-99) ncidpl=ncidu 1467 1468 endif 1468 1469 ! Vent meridien 1469 if(guide_v) THEN1470 IF (guide_v) THEN 1470 1471 rcode = nf90_open('v.nc', nf90_nowrite, ncidv) 1471 1472 IF (rcode/=nf90_noerr) THEN … … 1479 1480 ENDIF 1480 1481 WRITE(*,*)trim(modname)//' ncidv,varidv',ncidv,varidv 1481 if(ncidpl==-99) ncidpl=ncidv1482 IF (ncidpl==-99) ncidpl=ncidv 1482 1483 endif 1483 1484 ! Temperature 1484 if(guide_T) THEN1485 IF (guide_T) THEN 1485 1486 rcode = nf90_open('T.nc', nf90_nowrite, ncidt) 1486 1487 IF (rcode/=nf90_noerr) THEN … … 1494 1495 ENDIF 1495 1496 WRITE(*,*)trim(modname)//' ncidT,varidT',ncidt,varidt 1496 if(ncidpl==-99) ncidpl=ncidt1497 IF (ncidpl==-99) ncidpl=ncidt 1497 1498 endif 1498 1499 ! Humidite 1499 if(guide_Q) THEN1500 IF (guide_Q) THEN 1500 1501 rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ) 1501 1502 IF (rcode/=nf90_noerr) THEN … … 1509 1510 ENDIF 1510 1511 WRITE(*,*)trim(modname)//' ncidQ,varidQ',ncidQ,varidQ 1511 if(ncidpl==-99) ncidpl=ncidQ1512 IF (ncidpl==-99) ncidpl=ncidQ 1512 1513 endif 1513 1514 ! Pression de surface 1514 if((guide_P).OR.(guide_modele)) THEN1515 IF ((guide_P).OR.(guide_modele)) THEN 1515 1516 rcode = nf90_open('ps.nc', nf90_nowrite, ncidps) 1516 1517 IF (rcode/=nf90_noerr) THEN … … 1526 1527 endif 1527 1528 ! Coordonnee verticale 1528 if(guide_plevs==0) THEN1529 IF (guide_plevs==0) THEN 1529 1530 rcode = nf90_inq_varid(ncidpl, 'LEVEL', varidpl) 1530 1531 IF (rcode/=0) rcode = nf90_inq_varid(ncidpl, 'PRESSURE', varidpl) … … 1532 1533 endif 1533 1534 ! Coefs ap, bp pour calcul de la pression aux differents niveaux 1534 if(guide_plevs==1) THEN1535 IF (guide_plevs==1) THEN 1535 1536 status=nf90_get_var(ncidpl,varidap,apnc,[1],[nlevnc]) 1536 1537 status=nf90_get_var(ncidpl,varidbp,bpnc,[1],[nlevnc]) … … 1559 1560 1560 1561 ! Pression 1561 if(guide_plevs==2) THEN1562 IF (guide_plevs==2) THEN 1562 1563 status=nf90_get_var(ncidp,varidp,zu,start,count) 1563 1564 DO i=1,iip1 … … 1572 1573 endif 1573 1574 ! Vent zonal 1574 if(guide_u) THEN1575 IF (guide_u) THEN 1575 1576 status=nf90_get_var(ncidu,varidu,zu,start,count) 1576 1577 DO i=1,iip1 … … 1585 1586 1586 1587 ! Temperature 1587 if(guide_T) THEN1588 IF (guide_T) THEN 1588 1589 status=nf90_get_var(ncidt,varidt,zu,start,count) 1589 1590 DO i=1,iip1 … … 1598 1599 1599 1600 ! Humidite 1600 if(guide_Q) THEN1601 IF (guide_Q) THEN 1601 1602 status=nf90_get_var(ncidQ,varidQ,zu,start,count) 1602 1603 DO i=1,iip1 … … 1611 1612 1612 1613 ! Vent meridien 1613 if(guide_v) THEN1614 IF (guide_v) THEN 1614 1615 count(2)=jjm 1615 1616 status=nf90_get_var(ncidv,varidv,zv,start,count) … … 1625 1626 1626 1627 ! Pression de surface 1627 if((guide_P).OR.(guide_plevs==1)) THEN1628 IF ((guide_P).OR.(guide_plevs==1)) THEN 1628 1629 start(3)=timestep 1629 1630 start(4)=0 … … 1797 1798 !=========================================================================== 1798 1799 SUBROUTINE correctbid(iim,nl,x) 1799 integeriim,nl1800 realx(iim+1,nl)1801 integeri,l1802 realzz1800 INTEGER iim,nl 1801 REAL x(iim+1,nl) 1802 INTEGER i,l 1803 REAL zz 1803 1804 1804 1805 do l=1,nl -
LMDZ6/branches/Amaury_dev/libf/dyn3d/iniacademic.F90
r5116 r5117 7 7 USE infotrac, ONLY: nqtot, niso, iqIsoPha, tracers, getKey, isoName 8 8 USE control_mod, ONLY: day_step,planet_type 9 useexner_hyb_m, ONLY: exner_hyb10 useexner_milieu_m, ONLY: exner_milieu9 USE exner_hyb_m, ONLY: exner_hyb 10 USE exner_milieu_m, ONLY: exner_milieu 11 11 USE IOIPSL, ONLY: getin 12 USE Write_Field12 USE lmdz_write_field 13 13 USE comconst_mod, ONLY: cpp, kappa, g, daysec, dtvr, pi, im, jm 14 14 USE logic_mod, ONLY: iflag_phys, read_start … … 16 16 USE temps_mod, ONLY: annee_ref, day_ini, day_ref 17 17 USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0 18 USE readTracFiles_mod, ONLY: addPhase 19 use netcdf, ONLY: nf90_nowrite,nf90_open,nf90_noerr,nf90_inq_varid,nf90_close,nf90_get_var 18 USE lmdz_readTracFiles, ONLY: addPhase 19 USE netcdf, ONLY: nf90_nowrite,nf90_open,nf90_noerr,nf90_inq_varid,nf90_close,nf90_get_var 20 USE lmdz_ran1, ONLY: ran1 20 21 21 22 ! Author: Frederic Hourdin original: 15/01/93 … … 56 57 REAL phi(ip1jmp1,llm) ! geopotentiel 57 58 REAL ddsin,zsig,tetapv,w_pv ! variables auxiliaires 58 realtetastrat ! potential temperature in the stratosphere, in K59 realtetajl(jjp1,llm)59 REAL tetastrat ! potential temperature in the stratosphere, in K 60 REAL tetajl(jjp1,llm) 60 61 INTEGER i,j,l,lsup,ij, iq, iName, iPhase, iqParent 61 62 62 63 INTEGER :: nid_relief,varid,ierr 63 real, dimension(iip1,jjp1) :: relief64 REAL, DIMENSION(iip1,jjp1) :: relief 64 65 65 66 REAL teta0,ttp,delt_y,delt_z,eps ! Constantes pour profil de T … … 69 70 REAL phi_pv,dphi_pv,gam_pv,tetanoise ! Constantes pour polar vortex 70 71 71 real zz,ran172 integeridum72 REAL zz 73 INTEGER idum 73 74 74 75 REAL zdtvr, tnat, alpha_ideal … … 79 80 80 81 ! Sanity check: verify that options selected by user are not incompatible 81 if ((iflag_phys==1).and. .not. read_start) THEN82 IF ((iflag_phys==1).AND. .NOT. read_start) THEN 82 83 WRITE(lunout,*) trim(modname)," error: if read_start is set to ", & 83 84 " false then iflag_phys should not be 1" … … 85 86 " (iflag_phys >= 100)" 86 87 CALL abort_gcm(modname,"incompatible iflag_phys==1 and read_start==.FALSE.",1) 87 endif88 ENDIF 88 89 89 90 !----------------------------------------------------------------------- … … 109 110 ang0 = 0. 110 111 111 if(llm == 1) THEN112 IF (llm == 1) THEN 112 113 ! specific initializations for the shallow water case 113 114 kappa=1 114 endif115 ENDIF 115 116 116 117 CALL iniconst … … 136 137 relief=0. 137 138 ierr = nf90_open ('relief_in.nc', nf90_nowrite,nid_relief) 138 if(ierr==nf90_noerr) THEN139 IF (ierr==nf90_noerr) THEN 139 140 ierr=nf90_inq_varid(nid_relief,'RELIEF',varid) 140 if(ierr==nf90_noerr) THEN141 IF (ierr==nf90_noerr) THEN 141 142 ierr=nf90_get_var(nid_relief,varid,relief(1:iim,1:jjp1)) 142 143 relief(iip1,:)=relief(1,:) … … 164 165 CALL pression ( ip1jmp1, ap, bp, ps, p ) 165 166 166 if(pressure_exner) THEN167 IF (pressure_exner) THEN 167 168 CALL exner_hyb( ip1jmp1, ps, p, pks, pk) 168 169 else … … 172 173 ENDIF 173 174 174 if(llm == 1) THEN175 IF (llm == 1) THEN 175 176 ! initialize fields for the shallow water case, if required 176 if (.not.read_start) THEN177 IF (.NOT.read_start) THEN 177 178 phis(:)=0. 178 179 q(:,:,:)=0 179 180 CALL sw_case_williamson91_6(vcov,ucov,teta,masse,ps) 180 181 endif 181 endif182 ENDIF 182 183 183 184 academic_case: if (iflag_phys >= 2) THEN … … 249 250 tetajl(j,l)=teta0-delt_y*ddsin*ddsin+eps*ddsin & 250 251 -delt_z*(1.-ddsin*ddsin)*log(zsig) 251 if(planet_type=="giant") THEN252 IF (planet_type=="giant") THEN 252 253 tetajl(j,l)=teta0+(delt_y* & 253 254 ((sin(rlatu(j)*3.14159*eps+0.0001))**2) & … … 293 294 294 295 ! winds 295 if(ok_geost) THEN296 IF (ok_geost) THEN 296 297 CALL ugeostr(phi,ucov) 297 298 else … … 301 302 302 303 ! bulk initialization of tracers 303 if(planet_type=="earth") THEN304 IF (planet_type=="earth") THEN 304 305 ! Earth: first two tracers will be water 305 306 do iq=1,nqtot … … 311 312 ! distill de Rayleigh très simplifiée 312 313 iName = tracers(iq)%iso_iName 313 if(niso <= 0 .OR. iName <= 0) CYCLE314 IF (niso <= 0 .OR. iName <= 0) CYCLE 314 315 iPhase = tracers(iq)%iso_iPhase 315 316 iqParent = tracers(iq)%iqParent 316 317 IF(tracers(iq)%iso_iZone == 0) THEN 317 if(tnat1) THEN318 IF (tnat1) THEN 318 319 tnat=1.0 319 320 alpha_ideal=1.0 … … 358 359 359 360 ENDIF ! of IF (.NOT. read_start) 360 endifacademic_case361 ENDIF academic_case 361 362 362 363 END SUBROUTINE iniacademic -
LMDZ6/branches/Amaury_dev/libf/dyn3d/iniinterp_horiz.F90
r5116 r5117 116 116 do jj = 1, jmn + 1 117 117 do j = 1, jmo + 1 118 if((cn(jj)<d(j)).and.(dn(jj)>c(j)))THEN118 IF((cn(jj)<d(j)).AND.(dn(jj)>c(j)))THEN 119 119 do ii = 1, imn + 1 120 120 do i = 1, imo + 1 121 if (((an(ii)<b(i)).and.(bn(ii)>a(i))) &122 . or. ((an(ii)<b(i) - 2 * pi).and.(bn(ii)>a(i) - 2 * pi) &123 . and.(b(i) - 2 * pi<-pi)) &124 . or. ((an(ii)<b(i) + 2 * pi).and.(bn(ii)>a(i) + 2 * pi) &125 . and.(a(i) + 2 * pi>pi)) &121 IF (((an(ii)<b(i)).AND.(bn(ii)>a(i))) & 122 .OR. ((an(ii)<b(i) - 2 * pi).AND.(bn(ii)>a(i) - 2 * pi) & 123 .AND.(b(i) - 2 * pi<-pi)) & 124 .OR. ((an(ii)<b(i) + 2 * pi).AND.(bn(ii)>a(i) + 2 * pi) & 125 .AND.(a(i) + 2 * pi>pi)) & 126 126 )THEN 127 127 ktotal = ktotal + 1 … … 133 133 dd = min(d(j), dn(jj)) 134 134 cc = cn(jj) 135 if(cc< c(j))cc = c(j)136 if((an(ii)<b(i) - 2 * pi).and. &135 IF (cc< c(j))cc = c(j) 136 IF((an(ii)<b(i) - 2 * pi).AND. & 137 137 (bn(ii)>a(i) - 2 * pi)) THEN 138 138 bb = min(b(i) - 2 * pi, bn(ii)) 139 139 aa = an(ii) 140 if(aa<a(i) - 2 * pi) aa = a(i) - 2 * pi141 else if((an(ii)<b(i) + 2 * pi).and. &140 IF (aa<a(i) - 2 * pi) aa = a(i) - 2 * pi 141 ELSE IF((an(ii)<b(i) + 2 * pi).AND. & 142 142 (bn(ii)>a(i) + 2 * pi)) THEN 143 143 bb = min(b(i) + 2 * pi, bn(ii)) 144 144 aa = an(ii) 145 if(aa<a(i) + 2 * pi) aa = a(i) + 2 * pi145 IF (aa<a(i) + 2 * pi) aa = a(i) + 2 * pi 146 146 else 147 147 bb = min(b(i), bn(ii)) 148 148 aa = an(ii) 149 if(aa<a(i)) aa = a(i)149 IF (aa<a(i)) aa = a(i) 150 150 end if 151 151 intersec(ktotal) = (bb - aa) * (sin(dd) - sin(cc)) … … 165 165 ! i = ik(k) 166 166 ! j = jk(k) 167 ! if ((ii. eq.10).and.(jj.eq.10).and.(i.eq.10).and.(j.eq.10))THEN168 ! if (jj. eq.2.and.(ii.eq.1))THEN167 ! if ((ii.EQ.10).AND.(jj.EQ.10).AND.(i.EQ.10).AND.(j.EQ.10))THEN 168 ! if (jj.EQ.2.AND.(ii.EQ.1))THEN 169 169 ! WRITE(*,*) '**************** jj=',jj,'ii=',ii 170 170 ! WRITE(*,*) 'i,j =',i,j -
LMDZ6/branches/Amaury_dev/libf/dyn3d/integrd.F90
r5116 r5117 6 6 ) 7 7 8 usecontrol_mod, ONLY: planet_type9 usecomconst_mod, ONLY: pi8 USE control_mod, ONLY: planet_type 9 USE comconst_mod, ONLY: pi 10 10 USE logic_mod, ONLY: leapf 11 usecomvert_mod, ONLY: ap, bp11 USE comvert_mod, ONLY: ap, bp 12 12 USE temps_mod, ONLY: dt 13 13 … … 38 38 ! ---------- 39 39 40 integer, intent(in) :: nq ! number of tracers to handle in this routine41 real, intent(inout) :: vcov(ip1jm, llm) ! covariant meridional wind42 real, intent(inout) :: ucov(ip1jmp1, llm) ! covariant zonal wind43 real, intent(inout) :: teta(ip1jmp1, llm) ! potential temperature44 real, intent(inout) :: q(ip1jmp1, llm, nq) ! advected tracers45 real, intent(inout) :: ps(ip1jmp1) ! surface pressure46 real, intent(inout) :: masse(ip1jmp1, llm) ! atmospheric mass47 real, intent(in) :: phis(ip1jmp1) ! ground geopotential !!! unused40 INTEGER, INTENT(IN) :: nq ! number of tracers to handle in this routine 41 REAL, INTENT(INOUT) :: vcov(ip1jm, llm) ! covariant meridional wind 42 REAL, INTENT(INOUT) :: ucov(ip1jmp1, llm) ! covariant zonal wind 43 REAL, INTENT(INOUT) :: teta(ip1jmp1, llm) ! potential temperature 44 REAL, INTENT(INOUT) :: q(ip1jmp1, llm, nq) ! advected tracers 45 REAL, INTENT(INOUT) :: ps(ip1jmp1) ! surface pressure 46 REAL, INTENT(INOUT) :: masse(ip1jmp1, llm) ! atmospheric mass 47 REAL, INTENT(IN) :: phis(ip1jmp1) ! ground geopotential !!! unused 48 48 ! values at previous time step 49 real, intent(inout) :: vcovm1(ip1jm, llm)50 real, intent(inout) :: ucovm1(ip1jmp1, llm)51 real, intent(inout) :: tetam1(ip1jmp1, llm)52 real, intent(inout) :: psm1(ip1jmp1)53 real, intent(inout) :: massem1(ip1jmp1, llm)49 REAL, INTENT(INOUT) :: vcovm1(ip1jm, llm) 50 REAL, INTENT(INOUT) :: ucovm1(ip1jmp1, llm) 51 REAL, INTENT(INOUT) :: tetam1(ip1jmp1, llm) 52 REAL, INTENT(INOUT) :: psm1(ip1jmp1) 53 REAL, INTENT(INOUT) :: massem1(ip1jmp1, llm) 54 54 ! the tendencies to add 55 real, intent(in) :: dv(ip1jm, llm)56 real, intent(in) :: du(ip1jmp1, llm)57 real, intent(in) :: dteta(ip1jmp1, llm)58 real, intent(in) :: dp(ip1jmp1)59 real, intent(in) :: dq(ip1jmp1, llm, nq) !!! unused60 ! real,intent(out) :: finvmaold(ip1jmp1,llm) !!! unused55 REAL, INTENT(IN) :: dv(ip1jm, llm) 56 REAL, INTENT(IN) :: du(ip1jmp1, llm) 57 REAL, INTENT(IN) :: dteta(ip1jmp1, llm) 58 REAL, INTENT(IN) :: dp(ip1jmp1) 59 REAL, INTENT(IN) :: dq(ip1jmp1, llm, nq) !!! unused 60 ! REAL,INTENT(OUT) :: finvmaold(ip1jmp1,llm) !!! unused 61 61 62 62 ! Local: … … 203 203 !$$$ ENDIF 204 204 205 if(planet_type=="earth") THEN205 IF (planet_type=="earth") THEN 206 206 ! Earth-specific treatment of first 2 tracers (water) 207 207 DO l = 1, llm … … 238 238 ! CALL SCOPY( ijp1llm , finvmasse, 1, finvmaold, 1 ) 239 239 240 endif ! of if (planet_type.eq."earth")240 ENDIF ! of if (planet_type.EQ."earth") 241 241 ! 242 242 ! -
LMDZ6/branches/Amaury_dev/libf/dyn3d/interp_horiz.F90
r5116 r5117 48 48 REAL :: totn, tots 49 49 50 logical:: firstcall, firsttest, aire_ok50 LOGICAL :: firstcall, firsttest, aire_ok 51 51 save firsttest 52 52 data firsttest /.TRUE./ … … 108 108 !--------------------------------------------------------------- 109 109 ! TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST 110 !! if (. not.(firsttest)) goto 99110 !! if (.NOT.(firsttest)) goto 99 111 111 !! firsttest = .FALSE. 112 112 !! ! write (*,*) 'INTERP. HORIZ. : TEST SUR LES AIRES:' … … 128 128 !! do ii=1, imn+1 129 129 !! r = airen(ii,jj)/airetest(ii,jj) 130 !! if ((r.gt.1.001). or.(r.lt.0.999)) THEN130 !! if ((r.gt.1.001).OR.(r.lt.0.999)) THEN 131 131 !! ! write (*,*) '********** PROBLEME D'' AIRES !!!', 132 132 !! ! & ' DANS L''INTERPOLATION HORIZONTALE' -
LMDZ6/branches/Amaury_dev/libf/dyn3d/leapfrog.F90
r5116 r5117 7 7 8 8 !IM : pour sortir les param. du modele dans un fis. netcdf 110106 9 useIOIPSL9 USE IOIPSL 10 10 USE infotrac, ONLY: nqtot, isoCheck 11 11 USE guide_mod, ONLY: guide_main 12 USE write_field, ONLY: writefield12 USE lmdz_write_field, ONLY: writefield 13 13 USE control_mod, ONLY: nday, day_step, planet_type, offline, & 14 14 iconser, iphysiq, iperiod, dissip_period, & 15 15 iecri, ip_ebil_dyn, ok_dynzon, ok_dyn_ins, & 16 16 periodav, ok_dyn_ave, output_grads_dyn 17 useexner_hyb_m, ONLY: exner_hyb18 useexner_milieu_m, ONLY: exner_milieu17 USE exner_hyb_m, ONLY: exner_hyb 18 USE exner_milieu_m, ONLY: exner_milieu 19 19 USE comvert_mod, ONLY: ap, bp, pressure_exner, presnivs 20 20 USE comconst_mod, ONLY: cpp, dtphys, dtvr, pi, ihf … … 23 23 USE temps_mod, ONLY: jD_ref, jH_ref, itaufin, day_ini, day_ref, & 24 24 start_time, dt 25 USE strings_mod, ONLY: msg25 USE lmdz_strings, ONLY: msg 26 26 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_PHYS 27 27 USE lmdz_description, ONLY: descript … … 146 146 REAL :: zx_tmp_2d(iip1, jjp1) 147 147 INTEGER :: ndex2d(iip1 * jjp1) 148 logical:: ok_sync148 LOGICAL :: ok_sync 149 149 parameter (ok_sync = .TRUE.) 150 logical:: physic150 LOGICAL :: physic 151 151 152 152 data callinigrads/.TRUE./ … … 174 174 CHARACTER(LEN = 80) :: abort_message 175 175 176 logical:: dissip_conservative176 LOGICAL :: dissip_conservative 177 177 save dissip_conservative 178 178 data dissip_conservative/.TRUE./ … … 188 188 INTEGER :: itau_w ! pas de temps ecriture = itap + itau_phy 189 189 190 if(nday>=0) THEN190 IF (nday>=0) THEN 191 191 itaufin = nday * day_step 192 192 else 193 193 itaufin = -nday 194 endif194 ENDIF 195 195 itaufinp1 = itaufin + 1 196 196 itau = 0 197 197 physic = .TRUE. 198 if (iflag_phys==0.or.iflag_phys==2) physic = .FALSE.198 IF (iflag_phys==0.OR.iflag_phys==2) physic = .FALSE. 199 199 200 200 ! iday = day_ini+itau/day_step … … 212 212 dq(:, :, :) = 0. 213 213 CALL pression (ip1jmp1, ap, bp, ps, p) 214 if(pressure_exner) THEN214 IF (pressure_exner) THEN 215 215 CALL exner_hyb(ip1jmp1, ps, p, pks, pk, pkf) 216 216 else 217 217 CALL exner_milieu(ip1jmp1, ps, p, pks, pk, pkf) 218 endif218 ENDIF 219 219 220 220 !----------------------------------------------------------------------- … … 236 236 CALL check_isotopes_seq(q, ip1jmp1, 'leapfrog 321') 237 237 238 if(ok_guide) THEN238 IF (ok_guide) THEN 239 239 CALL guide_main(itau,ucov,vcov,teta,q,masse,ps) 240 endif240 ENDIF 241 241 242 242 … … 299 299 apdiss = .TRUE. 300 300 IF(MOD(itau, iphysiq)==0.AND..NOT.forward & 301 . and. physic) apphys = .TRUE.301 .AND. physic) apphys = .TRUE. 302 302 ELSE 303 303 ! Leapfrog/Matsuno time stepping … … 310 310 ! Ehouarn: for Shallow Water case (ie: 1 vertical layer), 311 311 ! supress dissipation step 312 if(llm==1) THEN312 IF (llm==1) THEN 313 313 apdiss = .FALSE. 314 endif314 ENDIF 315 315 316 316 CALL check_isotopes_seq(q, ip1jmp1, 'leapfrog 589') … … 389 389 390 390 CALL pression (ip1jmp1, ap, bp, ps, p) 391 if(pressure_exner) THEN391 IF (pressure_exner) THEN 392 392 CALL exner_hyb(ip1jmp1, ps, p, pks, pk, pkf) 393 393 else … … 453 453 CALL pression (ip1jmp1, ap, bp, ps, p) 454 454 CALL massdair(p, masse) 455 if(pressure_exner) THEN455 IF (pressure_exner) THEN 456 456 CALL exner_hyb(ip1jmp1, ps, p, pks, pk, pkf) 457 457 else … … 485 485 ENDDO ! of DO l=1,llm 486 486 487 if(planet_type=="giant") THEN487 IF (planet_type=="giant") THEN 488 488 ! add an intrinsic heat flux at the base of the atmosphere 489 489 teta(:, 1) = teta(:, 1) + dtvr * aire(:) * ihf / cpp / masse(:, 1) … … 511 511 512 512 CALL pression (ip1jmp1, ap, bp, ps, p) 513 if(pressure_exner) THEN513 IF (pressure_exner) THEN 514 514 CALL exner_hyb(ip1jmp1, ps, p, pks, pk, pkf) 515 515 else 516 516 CALL exner_milieu(ip1jmp1, ps, p, pks, pk, pkf) 517 endif517 ENDIF 518 518 CALL massdair(p, masse) 519 519 … … 539 539 540 540 !------------------------------------------------------------------------ 541 if(dissip_conservative) THEN541 IF (dissip_conservative) THEN 542 542 ! On rajoute la tendance due a la transform. Ec -> E therm. cree 543 543 ! lors de la dissipation … … 570 570 ENDDO 571 571 572 if(1 == 0) THEN572 IF (1 == 0) THEN 573 573 !!! Ehouarn: lines here 1) kill 1+1=2 in the dynamics 574 574 !!! 2) should probably not be here anyway … … 621 621 622 622 IF(itau == itaufinp1) THEN 623 if(flag_verif) THEN623 IF (flag_verif) THEN 624 624 WRITE(79, *) 'ucov', ucov 625 625 WRITE(80, *) 'vcov', vcov … … 668 668 IF(MOD(itau, iecri)==0) THEN 669 669 ! ! Ehouarn: output only during LF or Backward Matsuno 670 if (leapf.or.(.not.leapf.and.(.not.forward))) THEN670 IF (leapf.OR.(.NOT.leapf.AND.(.NOT.forward))) THEN 671 671 CALL geopot(ip1jmp1, teta, pk, pks, phis, phi) 672 672 unat = 0. … … 675 675 vnat(:, l) = vcov(:, l) / cv(:) 676 676 enddo 677 if(ok_dyn_ins) THEN677 IF (ok_dyn_ins) THEN 678 678 ! WRITE(lunout,*) "leapfrog: CALL writehist, itau=",itau 679 679 CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis) … … 685 685 endif ! of if (ok_dyn_ins) 686 686 ! For some Grads outputs of fields 687 if(output_grads_dyn) THEN687 IF (output_grads_dyn) THEN 688 688 include "write_grads_dyn.h" 689 689 endif 690 endif ! of if (leapf. or.(.not.leapf.and.(.not.forward)))690 endif ! of if (leapf.OR.(.NOT.leapf.AND.(.NOT.forward))) 691 691 ENDIF ! of IF(MOD(itau,iecri).EQ.0) 692 692 … … 694 694 695 695 696 ! if (planet_type. eq."earth") THEN696 ! if (planet_type.EQ."earth") THEN 697 697 ! Write an Earth-format restart file 698 698 CALL dynredem1("restart.nc", start_time, & 699 699 vcov, ucov, teta, q, masse, ps) 700 ! endif ! of if (planet_type.eq."earth")700 ! END IF ! of if (planet_type.EQ."earth") 701 701 702 702 CLOSE(99) 703 if(ok_guide) THEN703 IF (ok_guide) THEN 704 704 ! ! set ok_guide to false to avoid extra output 705 705 ! ! in following forward step … … 741 741 ! ! ELSEIF (MOD(itau-1,iperiod).EQ.0) 742 742 743 ELSE ! of IF (. not.purmats)743 ELSE ! of IF (.NOT.purmats) 744 744 745 745 CALL check_isotopes_seq(q, ip1jmp1, 'leapfrog 1664') … … 799 799 vnat(:, l) = vcov(:, l) / cv(:) 800 800 enddo 801 if(ok_dyn_ins) THEN801 IF (ok_dyn_ins) THEN 802 802 ! WRITE(lunout,*) "leapfrog: CALL writehist (b)", 803 803 ! & itau,iecri … … 805 805 endif ! of if (ok_dyn_ins) 806 806 ! For some Grads outputs 807 if(output_grads_dyn) THEN807 IF (output_grads_dyn) THEN 808 808 include "write_grads_dyn.h" 809 809 endif … … 812 812 813 813 IF(itau==itaufin) THEN 814 ! if (planet_type. eq."earth") THEN814 ! if (planet_type.EQ."earth") THEN 815 815 CALL dynredem1("restart.nc", start_time, & 816 816 vcov, ucov, teta, q, masse, ps) 817 ! endif ! of if (planet_type.eq."earth")818 if(ok_guide) THEN817 ! END IF ! of if (planet_type.EQ."earth") 818 IF (ok_guide) THEN 819 819 ! ! set ok_guide to false to avoid extra output 820 820 ! ! in following forward step … … 828 828 ENDIF ! of IF (forward) 829 829 830 END IF ! of IF(. not.purmats)830 END IF ! of IF(.NOT.purmats) 831 831 832 832 END SUBROUTINE leapfrog -
LMDZ6/branches/Amaury_dev/libf/dyn3d/qminimum.F90
r5116 r5117 4 4 5 5 USE infotrac, ONLY: niso, ntiso, iqIsoPha, tracers 6 USE strings_mod, ONLY: strIdx7 USE readTracFiles_mod, ONLY: addPhase6 USE lmdz_strings, ONLY: strIdx 7 USE lmdz_readTracFiles, ONLY: addPhase 8 8 IMPLICIT none 9 9 ! … … 64 64 DO k = 1, llm 65 65 DO i = 1, ip1jmp1 66 if(seuil_liq - q(i, k, iq_liq) > 0.d0) THEN67 if(niso > 0) zx_defau_diag(i, k, 2) = AMAX1 &66 IF (seuil_liq - q(i, k, iq_liq) > 0.d0) THEN 67 IF (niso > 0) zx_defau_diag(i, k, 2) = AMAX1 & 68 68 (seuil_liq - q(i, k, iq_liq), 0.0) 69 69 … … 80 80 !cc zx_abc = dpres(k) / dpres(k-1) 81 81 DO i = 1, ip1jmp1 82 if(seuil_vap - q(i, k, iq_vap) > 0.d0) THEN83 if(niso > 0) zx_defau_diag(i, k, 1) &82 IF (seuil_vap - q(i, k, iq_vap) > 0.d0) THEN 83 IF (niso > 0) zx_defau_diag(i, k, 1) & 84 84 = AMAX1(seuil_vap - q(i, k, iq_vap), 0.0) 85 85 … … 112 112 113 113 !WRITE(*,*) 'qminimum 128' 114 if(niso > 0) THEN114 IF (niso > 0) THEN 115 115 ! CRisi: traiter de même les traceurs d'eau 116 116 ! Mais il faut les prendre à l'envers pour essayer de conserver la … … 121 121 ! génant 122 122 DO i = 1, ip1jmp1 123 if(zx_pump(i)>0.0) THEN123 IF (zx_pump(i)>0.0) THEN 124 124 q_follow(i, 1, 1) = q_follow(i, 1, 1) + zx_pump(i) 125 125 endif !if (zx_pump(i).gt.0.0) THEN … … 130 130 do k = 2, llm 131 131 DO i = 1, ip1jmp1 132 if(zx_defau_diag(i, k, 1)>0.0) THEN132 IF (zx_defau_diag(i, k, 1)>0.0) THEN 133 133 ! on ajoute la vapeur en k 134 134 do ixt = 1, ntiso … … 162 162 do k = 1, llm 163 163 DO i = 1, ip1jmp1 164 if(zx_defau_diag(i, k, 2)>0.0) THEN164 IF (zx_defau_diag(i, k, 2)>0.0) THEN 165 165 ! ! on ajoute eau liquide en k en k 166 166 do ixt = 1, ntiso … … 183 183 CALL check_isotopes_seq(q, ip1jmp1, 'qminimum 197') 184 184 185 endif!if (niso > 0) THEN185 ENDIF !if (niso > 0) THEN 186 186 ! !WRITE(*,*) 'qminimum 188' 187 187 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/replay3d.F90
r5116 r5117 101 101 CALL conf_gcm( 99, .TRUE.) 102 102 103 if(mod(iphysiq, iperiod) /= 0) CALL abort_gcm("conf_gcm", &103 IF (mod(iphysiq, iperiod) /= 0) CALL abort_gcm("conf_gcm", & 104 104 "iphysiq must be a multiple of iperiod", 1) 105 105 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/tetaleveli1j.F90
r5116 r5117 29 29 30 30 INTEGER :: ilon, ilev 31 logical:: lnew31 LOGICAL :: lnew 32 32 33 33 REAL :: pgcm(ilon, ilev) … … 54 54 ! PRINT*,'tetalevel pres=',pres 55 55 !===================================================================== 56 if(lnew) THEN56 IF (lnew) THEN 57 57 ! on réinitialise les réindicages et les poids 58 58 !===================================================================== … … 110 110 enddo 111 111 112 endif! lnew112 ENDIF ! lnew 113 113 114 114 !====================================================================== … … 125 125 do i = 1, ilon 126 126 !IM if (pgcm(i,1).LT.pres) THEN 127 if(pgcm(i, 1)>pres) THEN127 IF (pgcm(i, 1)>pres) THEN 128 128 ! Qpres(i)=1e33 129 129 Qpres(i) = 1e+20 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/tetaleveli1j1.F90
r5116 r5117 29 29 30 30 INTEGER :: ilon, ilev 31 logical:: lnew31 LOGICAL :: lnew 32 32 33 33 REAL :: pgcm(ilon, ilev) … … 54 54 ! PRINT*,'tetalevel pres=',pres 55 55 !===================================================================== 56 if(lnew) THEN56 IF (lnew) THEN 57 57 ! on réinitialise les réindicages et les poids 58 58 !===================================================================== … … 110 110 enddo 111 111 112 endif! lnew112 ENDIF ! lnew 113 113 114 114 !====================================================================== … … 125 125 do i = 1, ilon 126 126 !IM if (pgcm(i,1).LT.pres) THEN 127 if(pgcm(i, 1)>pres) THEN127 IF (pgcm(i, 1)>pres) THEN 128 128 ! Qpres(i)=1e33 129 129 Qpres(i) = 1e+20 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/top_bound.F90
r5116 r5117 58 58 ! ---------- 59 59 60 real, intent(inout) :: ucov(iip1, jjp1, llm) ! covariant zonal wind61 real, intent(inout) :: vcov(iip1, jjm, llm) ! covariant meridional wind62 real, intent(inout) :: teta(iip1, jjp1, llm) ! potential temperature63 real, intent(in) :: masse(iip1, jjp1, llm) ! mass of atmosphere64 real, intent(in) :: dt ! time step (s) of sponge model60 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 65 65 66 66 ! Local: … … 72 72 INTEGER :: i 73 73 REAL, SAVE :: rdamp(llm) ! quenching coefficient 74 real, save :: lambda(llm) ! inverse or quenching time scale (Hz)74 REAL, save :: lambda(llm) ! inverse or quenching time scale (Hz) 75 75 76 76 LOGICAL, SAVE :: first = .TRUE. … … 78 78 INTEGER :: j, l 79 79 80 if(iflag_top_bound==0) return80 IF (iflag_top_bound==0) return 81 81 82 if(first) THEN83 if(iflag_top_bound==1) THEN82 IF (first) THEN 83 IF (iflag_top_bound==1) THEN 84 84 ! sponge quenching over the topmost 4 atmospheric layers 85 85 lambda(:) = 0. … … 88 88 lambda(llm - 2) = tau_top_bound / 4. 89 89 lambda(llm - 3) = tau_top_bound / 8. 90 else if(iflag_top_bound==2) THEN90 ELSE IF (iflag_top_bound==2) THEN 91 91 ! sponge quenching over topmost layers down to pressures which are 92 92 ! higher than 100 times the topmost layer pressure … … 103 103 WRITE(lunout, *)'p (Pa) z(km) tau(s) 1./tau (Hz)' 104 104 do l = 1, llm 105 if(rdamp(l)/=0.) THEN105 IF (rdamp(l)/=0.) THEN 106 106 WRITE(lunout, '(6(1pe12.4,1x))') & 107 107 presnivs(l), log(preff / presnivs(l)) * scaleheight, & … … 110 110 enddo 111 111 first = .FALSE. 112 endif! of if (first)112 ENDIF ! of if (first) 113 113 114 114 CALL massbar(masse, massebx, masseby) 115 115 116 116 ! compute zonal average of vcov and u 117 if(mode_top_bound>=2) THEN117 IF (mode_top_bound>=2) THEN 118 118 do l = 1, llm 119 119 do j = 1, jjm … … 144 144 vzon(:, :) = 0. 145 145 uzon(:, :) = 0. 146 endif! of if (mode_top_bound.ge.2)146 ENDIF ! of if (mode_top_bound.ge.2) 147 147 148 148 ! compute zonal average of potential temperature, if necessary 149 if(mode_top_bound>=3) THEN149 IF (mode_top_bound>=3) THEN 150 150 do l = 1, llm 151 151 do j = 2, jjm ! excluding poles … … 159 159 enddo 160 160 enddo 161 endif! of if (mode_top_bound.ge.3)161 ENDIF ! of if (mode_top_bound.ge.3) 162 162 163 if(mode_top_bound>=1) THEN163 IF (mode_top_bound>=1) THEN 164 164 ! Apply sponge quenching on vcov: 165 165 do l = 1, llm … … 181 181 enddo 182 182 enddo 183 endif! of if (mode_top_bound.ge.1)183 ENDIF ! of if (mode_top_bound.ge.1) 184 184 185 if(mode_top_bound>=3) THEN185 IF (mode_top_bound>=3) THEN 186 186 ! Apply sponge quenching on teta: 187 187 do l = 1, llm … … 193 193 enddo 194 194 enddo 195 endif! of if (mode_top_bound.ge.3)195 ENDIF ! of if (mode_top_bound.ge.3) 196 196 197 197 END SUBROUTINE top_bound -
LMDZ6/branches/Amaury_dev/libf/dyn3d/vlsplt.F90
r5116 r5117 293 293 294 294 IF(n0>0) THEN 295 if(prt_level > 2) PRINT *, &295 IF (prt_level > 2) PRINT *, & 296 296 'Nombre de points pour lesquels on advect plus que le' & 297 297 ,'contenu de la maille : ',n0 … … 302 302 ! indicage des mailles concernees par le traitement special 303 303 DO ij=iip2,ip1jm 304 IF(iadvplus(ij,l)==1. and.mod(ij,iip1)/=0) THEN304 IF(iadvplus(ij,l)==1.AND.mod(ij,iip1)/=0) THEN 305 305 iju=iju+1 306 306 indu(iju)=ij … … 372 372 !Mvals: veiller a ce qu'on n'ait pas de denominateur nul 373 373 masseq(ij,l,iq2)=max(masse(ij,l,iq)*q(ij,l,iq),min_qMass) 374 if(q(ij,l,iq)>min_qParent) THEN374 IF (q(ij,l,iq)>min_qParent) THEN 375 375 Ratio(ij,l,iq2)=q(ij,l,iq2)/q(ij,l,iq) 376 376 else … … 688 688 ! !MVals: veiller a ce qu'on n'ait pas de denominateur nul 689 689 masseq(ij,l,iq2)=max(masse(ij,l,iq)*q(ij,l,iq),min_qMass) 690 if(q(ij,l,iq)>min_qParent) THEN690 IF (q(ij,l,iq)>min_qParent) THEN 691 691 Ratio(ij,l,iq2)=q(ij,l,iq2)/q(ij,l,iq) 692 692 else … … 855 855 ! !MVals: veiller a ce qu'on n'ait pas de denominateur nul 856 856 masseq(ij,l,iq2)=max(masse(ij,l,iq)*q(ij,l,iq),min_qMass) 857 if(q(ij,l,iq)>min_qParent) THEN857 IF (q(ij,l,iq)>min_qParent) THEN 858 858 Ratio(ij,l,iq2)=q(ij,l,iq2)/q(ij,l,iq) 859 859 else -
LMDZ6/branches/Amaury_dev/libf/dyn3d/vlspltqs.F90
r5116 r5117 391 391 ! indicage des mailles concernees par le traitement special 392 392 DO ij = iip2, ip1jm 393 IF(iadvplus(ij, l)==1. and.mod(ij, iip1)/=0) THEN393 IF(iadvplus(ij, l)==1.AND.mod(ij, iip1)/=0) THEN 394 394 iju = iju + 1 395 395 indu(iju) = ij -
LMDZ6/branches/Amaury_dev/libf/dyn3d/wrgrads.f90
r5116 r5117 18 18 REAL :: field(imx * jmx * lmx) 19 19 20 integer, parameter :: wp = selected_real_kind(p = 6, r = 36)20 INTEGER, parameter :: wp = selected_real_kind(p = 6, r = 36) 21 21 real(wp) field4(imx * jmx * lmx) 22 22 … … 28 28 INTEGER :: im, jm, lm, i, j, l, iv, iii, iji, iif, ijf 29 29 30 logical:: writectl30 LOGICAL :: writectl 31 31 32 writectl = . false.32 writectl = .FALSE. 33 33 34 34 ! print*,if,iid(if),jid(if),ifd(if),jfd(if) … … 46 46 IF(firsttime(if)) THEN 47 47 IF(name==var(1, if)) THEN 48 firsttime(if) = . false.48 firsttime(if) = .FALSE. 49 49 ivar(if) = 1 50 50 print*, 'fin de l initialiation de l ecriture du fichier' … … 63 63 ! print*,'if ivar(if) nld ',if,ivar(if),nld(ivar(if),if) 64 64 endif 65 writectl = . true.65 writectl = .TRUE. 66 66 itime(if) = 1 67 67 else 68 68 ivar(if) = mod(ivar(if), nvar(if)) + 1 69 if(ivar(if)==nvar(if)) THEN70 writectl = . true.69 IF (ivar(if)==nvar(if)) THEN 70 writectl = .TRUE. 71 71 itime(if) = itime(if) + 1 72 72 endif … … 81 81 CALL abort_gcm("wrgrads", "problem", 1) 82 82 endif 83 endif83 ENDIF 84 84 85 85 ! print*,'ivar(if),nvar(if),var(ivar(if),if),writectl' … … 95 95 , i = iii, iif), j = iji, ijf) 96 96 enddo 97 if(writectl) THEN97 IF (writectl) THEN 98 98 file = fichier(if) 99 99 ! WARNING! on reecrase le fichier .ctl a chaque ecriture … … 105 105 WRITE(unit(if), '(a12)') 'UNDEF 1.0E30' 106 106 WRITE(unit(if), '(a5,1x,a40)') 'TITLE ', title(if) 107 CALL formcoord(unit(if), im, xd(iii, if), 1., . false., 'XDEF')108 CALL formcoord(unit(if), jm, yd(iji, if), 1., . true., 'YDEF')109 CALL formcoord(unit(if), lm, zd(1, if), 1., . false., 'ZDEF')107 CALL formcoord(unit(if), im, xd(iii, if), 1., .FALSE., 'XDEF') 108 CALL formcoord(unit(if), jm, yd(iji, if), 1., .TRUE., 'YDEF') 109 CALL formcoord(unit(if), lm, zd(1, if), 1., .FALSE., 'ZDEF') 110 110 WRITE(unit(if), '(a4,i10,a30)') & 111 111 'TDEF ', itime(if), ' LINEAR 02JAN1987 1MO ' … … 123 123 close(unit(if)) 124 124 125 endif! writectl125 ENDIF ! writectl 126 126 127 127 END SUBROUTINE wrgrads -
LMDZ6/branches/Amaury_dev/libf/dyn3d/write_paramLMDZ_dyn.h
r5116 r5117 107 107 . zx_tmp_2d,iip1*jjp1,ndex2d) 108 108 c 109 if(calend == 'earth_360d') THEN109 IF (calend == 'earth_360d') THEN 110 110 zx_tmp_2d(1:iip1,1:jjp1)=1. 111 else if(calend == 'earth_365d') THEN111 ELSE IF (calend == 'earth_365d') THEN 112 112 zx_tmp_2d(1:iip1,1:jjp1)=2. 113 else if(calend == 'earth_366d') THEN113 ELSE IF (calend == 'earth_366d') THEN 114 114 zx_tmp_2d(1:iip1,1:jjp1)=3. 115 115 endif … … 240 240 c================================================================= 241 241 c 242 if(ok_sync) THEN242 IF (ok_sync) THEN 243 243 CALL histsync(nid_ctesGCM) 244 244 endif
Note: See TracChangeset
for help on using the changeset viewer.