Changeset 5116 for LMDZ6/branches/Amaury_dev/libf/dyn3d
- Timestamp:
- Jul 24, 2024, 2:54:37 PM (4 months ago)
- Location:
- LMDZ6/branches/Amaury_dev/libf/dyn3d
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/dyn3d/abort_gcm.F90
r5103 r5116 19 19 ! ierr = severity of situation ( = 0 normal ) 20 20 21 character(len= *), intent(in) :: modname21 CHARACTER(LEN = *), intent(in) :: modname 22 22 integer, intent(in) :: ierr 23 character(len= *), intent(in) :: message23 CHARACTER(LEN = *), intent(in) :: message 24 24 25 write(lunout, *) 'in abort_gcm'25 WRITE(lunout, *) 'in abort_gcm' 26 26 27 27 IF (using_xios) THEN … … 33 33 CALL restclo 34 34 CALL getin_dump 35 write(lunout, *) 'Stopping in ', modname36 write(lunout, *) 'Reason = ', message37 if (ierr == 0) then38 write(lunout, *) 'Everything is cool'35 WRITE(lunout, *) 'Stopping in ', modname 36 WRITE(lunout, *) 'Reason = ', message 37 if (ierr == 0) THEN 38 WRITE(lunout, *) 'Everything is cool' 39 39 stop 40 40 else 41 write(lunout, *) 'Houston, we have a problem, ierr = ', ierr41 WRITE(lunout, *) 'Houston, we have a problem, ierr = ', ierr 42 42 stop 1 43 43 endif -
LMDZ6/branches/Amaury_dev/libf/dyn3d/addfi.F90
r5113 r5116 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 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/advtrac.f90
r5114 r5116 15 15 USE strings_mod, ONLY: int2str 16 16 USE lmdz_description, ONLY: descript 17 USE lmdz_libmath, ONLY: minmax 17 18 18 19 IMPLICIT NONE … … 49 50 REAL, DIMENSION(ip1jmp1, llm) :: pbaruc, pbarug, massem, wg 50 51 REAL, DIMENSION(ip1jm, llm) :: pbarvc, pbarvg 51 EXTERNAL minmax52 52 SAVE massem, pbaruc, pbarvc 53 53 !--------------------------------------------------------------------------- … … 129 129 ! Calcul des criteres CFL en X, Y et Z 130 130 !------------------------------------------------------------------------- 131 IF(countcfl == 0.) then131 IF(countcfl == 0.) THEN 132 132 cflxmax(:) = 0. 133 133 cflymax(:) = 0. … … 141 141 DO l = 1, llm 142 142 DO ij = iip2, ip1jm - 1 143 IF(pbarug(ij, l)>=0.) then143 IF(pbarug(ij, l)>=0.) THEN 144 144 cflx(ij, l) = pbarug(ij, l) * dtvr / masse(ij, l) 145 145 ELSE … … 157 157 DO l = 1, llm 158 158 DO ij = 1, ip1jm 159 IF(pbarvg(ij, l)>=0.) then159 IF(pbarvg(ij, l)>=0.) THEN 160 160 cfly(ij, l) = pbarvg(ij, l) * dtvr / masse(ij, l) 161 161 ELSE … … 184 184 ! Par defaut, on sort le diagnostic des CFL tous les jours. 185 185 ! Si on veut le sortir a chaque pas d'advection en cas de plantage 186 ! IF(countcfl==iapp_tracvl) then186 ! IF(countcfl==iapp_tracvl) THEN 187 187 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 188 IF(countcfl==day_step) then188 IF(countcfl==day_step) THEN 189 189 DO l = 1, llm 190 190 WRITE(lunout, *) 'L, CFL[xyz]max:', l, cflxmax(l), cflymax(l), cflzmax(l) -
LMDZ6/branches/Amaury_dev/libf/dyn3d/bilan_dyn.F90
r5106 r5116 36 36 ! =========== 37 37 38 integer:: ntrac39 real:: dt_app, dt_cum40 real:: ps(iip1, jjp1)41 real:: masse(iip1, jjp1, llm), pk(iip1, jjp1, llm)42 real:: flux_u(iip1, jjp1, llm)43 real:: flux_v(iip1, jjm, llm)44 real:: teta(iip1, jjp1, llm)45 real:: phi(iip1, jjp1, llm)46 real:: ucov(iip1, jjp1, llm)47 real:: vcov(iip1, jjm, llm)48 real:: trac(iip1, jjp1, llm, ntrac)38 INTEGER :: ntrac 39 REAL :: dt_app, dt_cum 40 REAL :: ps(iip1, jjp1) 41 REAL :: masse(iip1, jjp1, llm), pk(iip1, jjp1, llm) 42 REAL :: flux_u(iip1, jjp1, llm) 43 REAL :: flux_v(iip1, jjm, llm) 44 REAL :: teta(iip1, jjp1, llm) 45 REAL :: phi(iip1, jjp1, llm) 46 REAL :: ucov(iip1, jjp1, llm) 47 REAL :: vcov(iip1, jjm, llm) 48 REAL :: trac(iip1, jjp1, llm, ntrac) 49 49 50 50 ! Local : 51 51 ! ======= 52 52 53 integer:: icum, ncum53 INTEGER :: icum, ncum 54 54 logical :: first 55 real:: zz, zqy, zfactv(jjm, llm)56 57 integer:: nQ55 REAL :: zz, zqy, zfactv(jjm, llm) 56 57 INTEGER :: nQ 58 58 parameter (nQ = 7) 59 59 … … 64 64 character*6, save :: unites(nQ) 65 65 66 character(len= 10) :: file67 integer:: ifile66 CHARACTER(LEN = 10) :: file 67 INTEGER :: ifile 68 68 parameter (ifile = 4) 69 69 70 integer:: itemp, igeop, iecin, iang, iu, iovap, iun71 integer:: i_sortie70 INTEGER :: itemp, igeop, iecin, iang, iu, iovap, iun 71 INTEGER :: i_sortie 72 72 73 73 save first, icum, ncum … … 75 75 save i_sortie 76 76 77 real:: time78 integer:: itau77 REAL :: time 78 INTEGER :: itau 79 79 save time, itau 80 80 data time, itau/0., 0/ … … 84 84 data i_sortie/1/ 85 85 86 real:: ww86 REAL :: ww 87 87 88 88 ! variables dynamiques intermédiaires … … 95 95 96 96 ! champ contenant les scalaires advectés. 97 real:: Q(iip1, jjp1, llm, nQ)97 REAL :: Q(iip1, jjp1, llm, nQ) 98 98 99 99 ! champs cumulés 100 real:: ps_cum(iip1, jjp1)101 real:: masse_cum(iip1, jjp1, llm)102 real:: flux_u_cum(iip1, jjp1, llm)103 real:: flux_v_cum(iip1, jjm, llm)104 real:: Q_cum(iip1, jjp1, llm, nQ)105 real:: flux_uQ_cum(iip1, jjp1, llm, nQ)106 real:: flux_vQ_cum(iip1, jjm, llm, nQ)107 real:: flux_wQ_cum(iip1, jjp1, llm, nQ)108 real:: dQ(iip1, jjp1, llm, nQ)100 REAL :: ps_cum(iip1, jjp1) 101 REAL :: masse_cum(iip1, jjp1, llm) 102 REAL :: flux_u_cum(iip1, jjp1, llm) 103 REAL :: flux_v_cum(iip1, jjm, llm) 104 REAL :: Q_cum(iip1, jjp1, llm, nQ) 105 REAL :: flux_uQ_cum(iip1, jjp1, llm, nQ) 106 REAL :: flux_vQ_cum(iip1, jjm, llm, nQ) 107 REAL :: flux_wQ_cum(iip1, jjp1, llm, nQ) 108 REAL :: dQ(iip1, jjp1, llm, nQ) 109 109 110 110 save ps_cum, masse_cum, flux_u_cum, flux_v_cum … … 112 112 113 113 ! champs de tansport en moyenne zonale 114 integer:: ntr, itr114 INTEGER :: ntr, itr 115 115 parameter (ntr = 5) 116 116 … … 122 122 character*10, save :: zunites(ntr, nQ) 123 123 124 integer:: iave, itot, immc, itrs, istn124 INTEGER :: iave, itot, immc, itrs, istn 125 125 data iave, itot, immc, itrs, istn/1, 2, 3, 4, 5/ 126 character(len= 3) :: ctrs(ntr)126 CHARACTER(LEN = 3) :: ctrs(ntr) 127 127 data ctrs/' ', 'TOT', 'MMC', 'TRS', 'STN'/ 128 128 129 real:: zvQ(jjm, llm, ntr, nQ), zvQtmp(jjm, llm)130 real:: zavQ(jjm, ntr, nQ), psiQ(jjm, llm + 1, nQ)131 real:: zmasse(jjm, llm), zamasse(jjm)132 133 real:: zv(jjm, llm), psi(jjm, llm + 1)134 135 integer:: i, j, l, iQ129 REAL :: zvQ(jjm, llm, ntr, nQ), zvQtmp(jjm, llm) 130 REAL :: zavQ(jjm, ntr, nQ), psiQ(jjm, llm + 1, nQ) 131 REAL :: zmasse(jjm, llm), zamasse(jjm) 132 133 REAL :: zv(jjm, llm), psi(jjm, llm + 1) 134 135 INTEGER :: i, j, l, iQ 136 136 137 137 … … 139 139 ! --------------------------------------------------------- 140 140 141 character(len= 10) :: infile142 143 integer:: fileid144 integer:: thoriid, zvertiid141 CHARACTER(LEN = 10) :: infile 142 143 INTEGER :: fileid 144 INTEGER :: thoriid, zvertiid 145 145 save fileid 146 146 147 integer:: ndex3d(jjm * llm)147 INTEGER :: ndex3d(jjm * llm) 148 148 149 149 ! Variables locales 150 150 ! 151 integer:: tau0152 real:: zjulian153 character(len= 3) :: str154 character(len= 10) :: ctrac155 integer:: ii, jj156 integer:: zan, dayref157 ! 158 real:: rlong(jjm), rlatg(jjm)151 INTEGER :: tau0 152 REAL :: zjulian 153 CHARACTER(LEN = 3) :: str 154 CHARACTER(LEN = 10) :: ctrac 155 INTEGER :: ii, jj 156 INTEGER :: zan, dayref 157 ! 158 REAL :: rlong(jjm), rlatg(jjm) 159 159 160 160 … … 169 169 ndex3d = 0 170 170 171 if (first) then 172 171 if (first) THEN 173 172 icum = 0 174 173 ! initialisation des fichiers … … 176 175 ! ncum est la frequence de stokage en pas de temps 177 176 ncum = dt_cum / dt_app 178 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 179 178 WRITE(lunout, *) & 180 179 'Pb : le pas de cumule doit etre multiple du pas' … … 184 183 endif 185 184 186 if (i_sortie==1) then185 if (i_sortie==1) THEN 187 186 file = 'dynzon' 188 187 CALL inigrads(ifile, 1 & … … 235 234 do iQ = 1, nQ 236 235 do itr = 1, ntr 237 if(itr==1) then236 IF(itr==1) THEN 238 237 znom(itr, iQ) = nom(iQ) 239 238 znoml(itr, iQ) = nom(iQ) … … 327 326 !===================================================================== 328 327 ! 329 if(icum==0) then328 IF(icum==0) THEN 330 329 ps_cum = 0. 331 330 masse_cum = 0. … … 408 407 ! PAS DE TEMPS D'ECRITURE 409 408 !===================================================================== 410 if (icum==ncum) then409 if (icum==ncum) THEN 411 410 !===================================================================== 412 411 … … 529 528 ! PRINT*,'4OK' 530 529 ! sorties proprement dites 531 if (i_sortie==1) then530 if (i_sortie==1) THEN 532 531 do iQ = 1, nQ 533 532 do itr = 1, ntr -
LMDZ6/branches/Amaury_dev/libf/dyn3d/caladvtrac.F90
r5113 r5116 30 30 REAL :: pbaru(ip1jmp1, llm), pbarv(ip1jm, llm), masse(ip1jmp1, llm) 31 31 REAL :: p(ip1jmp1, llmp1), q(ip1jmp1, llm, nqtot) 32 real:: dq(ip1jmp1, llm, nqtot)32 REAL :: dq(ip1jmp1, llm, nqtot) 33 33 REAL :: teta(ip1jmp1, llm), pk(ip1jmp1, llm) 34 34 REAL :: flxw(ip1jmp1, llm) … … 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 … … 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 ! … … 84 84 ENDDO 85 85 86 ! write(*,*) 'caladvtrac 87'86 !WRITE(*,*) 'caladvtrac 87' 87 87 CALL qminimum(q, nqtot, finmasse) 88 ! write(*,*) 'caladvtrac 89'88 !WRITE(*,*) 'caladvtrac 89' 89 89 90 90 CALL SCOPY (ip1jmp1 * llm, masse, 1, finmasse, 1) … … 107 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. -
LMDZ6/branches/Amaury_dev/libf/dyn3d/check_isotopes.F90
r4984 r5116 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
r5113 r5116 6 6 use IOIPSL 7 7 USE infotrac, ONLY: type_trac 8 use lmdz_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, & … … 414 414 415 415 IF(ABS(clat - clatt)>= 0.001) THEN 416 write(lunout, *)'conf_gcm: La valeur de clat passee par run.def', &416 WRITE(lunout, *)'conf_gcm: La valeur de clat passee par run.def', & 417 417 ' est differente de celle lue sur le fichier start ' 418 418 CALL abort_gcm("conf_gcm", "stopped", 1) … … 428 428 429 429 IF(ABS(grossismx - grossismxx)>= 0.001) THEN 430 write(lunout, *)'conf_gcm: La valeur de grossismx passee par ', &430 WRITE(lunout, *)'conf_gcm: La valeur de grossismx passee par ', & 431 431 'run.def est differente de celle lue sur le fichier start ' 432 432 CALL abort_gcm("conf_gcm", "stopped", 1) … … 442 442 443 443 IF(ABS(grossismy - grossismyy)>= 0.001) THEN 444 write(lunout, *)'conf_gcm: La valeur de grossismy passee par ', &444 WRITE(lunout, *)'conf_gcm: La valeur de grossismy passee par ', & 445 445 'run.def est differente de celle lue sur le fichier start ' 446 446 CALL abort_gcm("conf_gcm", "stopped", 1) … … 448 448 449 449 IF(grossismx<1.) THEN 450 write(lunout, *) &450 WRITE(lunout, *) & 451 451 'conf_gcm: *** ATTENTION !! grossismx < 1 . *** ' 452 452 CALL abort_gcm("conf_gcm", "stopped", 1) … … 456 456 457 457 IF(grossismy<1.) THEN 458 write(lunout, *) &458 WRITE(lunout, *) & 459 459 'conf_gcm: *** ATTENTION !! grossismy < 1 . *** ' 460 460 CALL abort_gcm("conf_gcm", "stopped", 1) … … 463 463 ENDIF 464 464 465 write(lunout, *)'conf_gcm: alphax alphay', alphax, alphay465 WRITE(lunout, *)'conf_gcm: alphax alphay', alphax, alphay 466 466 467 467 ! alphax et alphay sont les anciennes formulat. des grossissements … … 477 477 IF(.NOT.fxyhypb) THEN 478 478 IF(fxyhypbb) THEN 479 write(lunout, *)' ******** PBS DANS CONF_GCM ******** '480 write(lunout, *)' *** fxyhypb lu sur le fichier start est ', &479 WRITE(lunout, *)' ******** PBS DANS CONF_GCM ******** ' 480 WRITE(lunout, *)' *** fxyhypb lu sur le fichier start est ', & 481 481 'F alors qu il est T sur run.def ***' 482 482 CALL abort_gcm("conf_gcm", "stopped", 1) … … 484 484 ELSE 485 485 IF(.NOT.fxyhypbb) THEN 486 write(lunout, *)' ******** PBS DANS CONF_GCM ******** '487 write(lunout, *)' *** fxyhypb lu sur le fichier start est ', &486 WRITE(lunout, *)' ******** PBS DANS CONF_GCM ******** ' 487 WRITE(lunout, *)' *** fxyhypb lu sur le fichier start est ', & 488 488 'T alors qu il est F sur run.def **** ' 489 489 CALL abort_gcm("conf_gcm", "stopped", 1) … … 501 501 IF(fxyhypb) THEN 502 502 IF(ABS(dzoomx - dzoomxx)>= 0.001) THEN 503 write(lunout, *)'conf_gcm: La valeur de dzoomx passee par ', &503 WRITE(lunout, *)'conf_gcm: La valeur de dzoomx passee par ', & 504 504 'run.def est differente de celle lue sur le fichier start ' 505 505 CALL abort_gcm("conf_gcm", "stopped", 1) … … 517 517 IF(fxyhypb) THEN 518 518 IF(ABS(dzoomy - dzoomyy)>= 0.001) THEN 519 write(lunout, *)'conf_gcm: La valeur de dzoomy passee par ', &519 WRITE(lunout, *)'conf_gcm: La valeur de dzoomy passee par ', & 520 520 'run.def est differente de celle lue sur le fichier start ' 521 521 CALL abort_gcm("conf_gcm", "stopped", 1) … … 532 532 IF(fxyhypb) THEN 533 533 IF(ABS(taux - tauxx)>= 0.001) THEN 534 write(lunout, *)'conf_gcm: La valeur de taux passee par ', &534 WRITE(lunout, *)'conf_gcm: La valeur de taux passee par ', & 535 535 'run.def est differente de celle lue sur le fichier start ' 536 536 CALL abort_gcm("conf_gcm", "stopped", 1) … … 547 547 IF(fxyhypb) THEN 548 548 IF(ABS(tauy - tauyy)>= 0.001) THEN 549 write(lunout, *)'conf_gcm: La valeur de tauy passee par ', &549 WRITE(lunout, *)'conf_gcm: La valeur de tauy passee par ', & 550 550 'run.def est differente de celle lue sur le fichier start ' 551 551 CALL abort_gcm("conf_gcm", "stopped", 1) … … 567 567 IF(.NOT.ysinus) THEN 568 568 IF(ysinuss) THEN 569 write(lunout, *)' ******** PBS DANS CONF_GCM ******** '570 write(lunout, *)' *** ysinus lu sur le fichier start est F', &569 WRITE(lunout, *)' ******** PBS DANS CONF_GCM ******** ' 570 WRITE(lunout, *)' *** ysinus lu sur le fichier start est F', & 571 571 ' alors qu il est T sur run.def ***' 572 572 CALL abort_gcm("conf_gcm", "stopped", 1) … … 574 574 ELSE 575 575 IF(.NOT.ysinuss) THEN 576 write(lunout, *)' ******** PBS DANS CONF_GCM ******** '577 write(lunout, *)' *** ysinus lu sur le fichier start est T', &576 WRITE(lunout, *)' ******** PBS DANS CONF_GCM ******** ' 577 WRITE(lunout, *)' *** ysinus lu sur le fichier start est T', & 578 578 ' alors qu il est F sur run.def **** ' 579 579 CALL abort_gcm("conf_gcm", "stopped", 1) … … 634 634 CALL getin('ok_dyn_ave', ok_dyn_ave) 635 635 636 write(lunout, *)' #########################################'637 write(lunout, *)' Configuration des parametres du gcm: '638 write(lunout, *)' planet_type = ', planet_type639 write(lunout, *)' calend = ', calend640 write(lunout, *)' dayref = ', dayref641 write(lunout, *)' anneeref = ', anneeref642 write(lunout, *)' nday = ', nday643 write(lunout, *)' day_step = ', day_step644 write(lunout, *)' iperiod = ', iperiod645 write(lunout, *)' nsplit_phys = ', nsplit_phys646 write(lunout, *)' iconser = ', iconser647 write(lunout, *)' iecri = ', iecri648 write(lunout, *)' periodav = ', periodav649 write(lunout, *)' output_grads_dyn = ', output_grads_dyn650 write(lunout, *)' dissip_period = ', dissip_period651 write(lunout, *)' lstardis = ', lstardis652 write(lunout, *)' nitergdiv = ', nitergdiv653 write(lunout, *)' nitergrot = ', nitergrot654 write(lunout, *)' niterh = ', niterh655 write(lunout, *)' tetagdiv = ', tetagdiv656 write(lunout, *)' tetagrot = ', tetagrot657 write(lunout, *)' tetatemp = ', tetatemp658 write(lunout, *)' coefdis = ', coefdis659 write(lunout, *)' purmats = ', purmats660 write(lunout, *)' read_start = ', read_start661 write(lunout, *)' iflag_phys = ', iflag_phys662 write(lunout, *)' iphysiq = ', iphysiq663 write(lunout, *)' clonn = ', clonn664 write(lunout, *)' clatt = ', clatt665 write(lunout, *)' grossismx = ', grossismx666 write(lunout, *)' grossismy = ', grossismy667 write(lunout, *)' fxyhypbb = ', fxyhypbb668 write(lunout, *)' dzoomxx = ', dzoomxx669 write(lunout, *)' dzoomy = ', dzoomyy670 write(lunout, *)' tauxx = ', tauxx671 write(lunout, *)' tauyy = ', tauyy672 write(lunout, *)' offline = ', offline673 write(lunout, *)' type_trac = ', type_trac674 write(lunout, *)' ok_dynzon = ', ok_dynzon675 write(lunout, *)' ok_dyn_ins = ', ok_dyn_ins676 write(lunout, *)' ok_dyn_ave = ', ok_dyn_ave677 write(lunout, *)' adv_qsat_liq = ', adv_qsat_liq636 WRITE(lunout, *)' #########################################' 637 WRITE(lunout, *)' Configuration des parametres du gcm: ' 638 WRITE(lunout, *)' planet_type = ', planet_type 639 WRITE(lunout, *)' calend = ', calend 640 WRITE(lunout, *)' dayref = ', dayref 641 WRITE(lunout, *)' anneeref = ', anneeref 642 WRITE(lunout, *)' nday = ', nday 643 WRITE(lunout, *)' day_step = ', day_step 644 WRITE(lunout, *)' iperiod = ', iperiod 645 WRITE(lunout, *)' nsplit_phys = ', nsplit_phys 646 WRITE(lunout, *)' iconser = ', iconser 647 WRITE(lunout, *)' iecri = ', iecri 648 WRITE(lunout, *)' periodav = ', periodav 649 WRITE(lunout, *)' output_grads_dyn = ', output_grads_dyn 650 WRITE(lunout, *)' dissip_period = ', dissip_period 651 WRITE(lunout, *)' lstardis = ', lstardis 652 WRITE(lunout, *)' nitergdiv = ', nitergdiv 653 WRITE(lunout, *)' nitergrot = ', nitergrot 654 WRITE(lunout, *)' niterh = ', niterh 655 WRITE(lunout, *)' tetagdiv = ', tetagdiv 656 WRITE(lunout, *)' tetagrot = ', tetagrot 657 WRITE(lunout, *)' tetatemp = ', tetatemp 658 WRITE(lunout, *)' coefdis = ', coefdis 659 WRITE(lunout, *)' purmats = ', purmats 660 WRITE(lunout, *)' read_start = ', read_start 661 WRITE(lunout, *)' iflag_phys = ', iflag_phys 662 WRITE(lunout, *)' iphysiq = ', iphysiq 663 WRITE(lunout, *)' clonn = ', clonn 664 WRITE(lunout, *)' clatt = ', clatt 665 WRITE(lunout, *)' grossismx = ', grossismx 666 WRITE(lunout, *)' grossismy = ', grossismy 667 WRITE(lunout, *)' fxyhypbb = ', fxyhypbb 668 WRITE(lunout, *)' dzoomxx = ', dzoomxx 669 WRITE(lunout, *)' dzoomy = ', dzoomyy 670 WRITE(lunout, *)' tauxx = ', tauxx 671 WRITE(lunout, *)' tauyy = ', tauyy 672 WRITE(lunout, *)' offline = ', offline 673 WRITE(lunout, *)' type_trac = ', type_trac 674 WRITE(lunout, *)' ok_dynzon = ', ok_dynzon 675 WRITE(lunout, *)' ok_dyn_ins = ', ok_dyn_ins 676 WRITE(lunout, *)' ok_dyn_ave = ', ok_dyn_ave 677 WRITE(lunout, *)' adv_qsat_liq = ', adv_qsat_liq 678 678 ELSE 679 679 !Config Key = clon … … 710 710 711 711 IF(grossismx<1.) THEN 712 write(lunout, *) &712 WRITE(lunout, *) & 713 713 'conf_gcm: *** ATTENTION !! grossismx < 1 . *** ' 714 714 CALL abort_gcm("conf_gcm", "stopped", 1) … … 718 718 719 719 IF(grossismy<1.) THEN 720 write(lunout, *) 'conf_gcm: ***ATTENTION !! grossismy < 1 . *** '720 WRITE(lunout, *) 'conf_gcm: ***ATTENTION !! grossismy < 1 . *** ' 721 721 CALL abort_gcm("conf_gcm", "stopped", 1) 722 722 ELSE … … 724 724 ENDIF 725 725 726 write(lunout, *)'conf_gcm: alphax alphay ', alphax, alphay726 WRITE(lunout, *)'conf_gcm: alphax alphay ', alphax, alphay 727 727 728 728 ! alphax et alphay sont les anciennes formulat. des grossissements … … 865 865 CALL getin('read_orop', read_orop) 866 866 867 write(lunout, *)' #########################################'868 write(lunout, *)' Configuration des parametres de cel0_limit: '869 write(lunout, *)' planet_type = ', planet_type870 write(lunout, *)' calend = ', calend871 write(lunout, *)' dayref = ', dayref872 write(lunout, *)' anneeref = ', anneeref873 write(lunout, *)' nday = ', nday874 write(lunout, *)' day_step = ', day_step875 write(lunout, *)' iperiod = ', iperiod876 write(lunout, *)' iconser = ', iconser877 write(lunout, *)' iecri = ', iecri878 write(lunout, *)' periodav = ', periodav879 write(lunout, *)' output_grads_dyn = ', output_grads_dyn880 write(lunout, *)' dissip_period = ', dissip_period881 write(lunout, *)' lstardis = ', lstardis882 write(lunout, *)' nitergdiv = ', nitergdiv883 write(lunout, *)' nitergrot = ', nitergrot884 write(lunout, *)' niterh = ', niterh885 write(lunout, *)' tetagdiv = ', tetagdiv886 write(lunout, *)' tetagrot = ', tetagrot887 write(lunout, *)' tetatemp = ', tetatemp888 write(lunout, *)' coefdis = ', coefdis889 write(lunout, *)' purmats = ', purmats890 write(lunout, *)' read_start = ', read_start891 write(lunout, *)' iflag_phys = ', iflag_phys892 write(lunout, *)' iphysiq = ', iphysiq893 write(lunout, *)' clon = ', clon894 write(lunout, *)' clat = ', clat895 write(lunout, *)' grossismx = ', grossismx896 write(lunout, *)' grossismy = ', grossismy897 write(lunout, *)' fxyhypb = ', fxyhypb898 write(lunout, *)' dzoomx = ', dzoomx899 write(lunout, *)' dzoomy = ', dzoomy900 write(lunout, *)' taux = ', taux901 write(lunout, *)' tauy = ', tauy902 write(lunout, *)' offline = ', offline903 write(lunout, *)' type_trac = ', type_trac904 write(lunout, *)' ok_dynzon = ', ok_dynzon905 write(lunout, *)' ok_dyn_ins = ', ok_dyn_ins906 write(lunout, *)' ok_dyn_ave = ', ok_dyn_ave907 write(lunout, *)' ok_strato = ', ok_strato908 write(lunout, *)' ok_gradsfile = ', ok_gradsfile909 write(lunout, *)' ok_limit = ', ok_limit910 write(lunout, *)' ok_etat0 = ', ok_etat0911 write(lunout, *)' ok_guide = ', ok_guide912 write(lunout, *)' read_orop = ', read_orop867 WRITE(lunout, *)' #########################################' 868 WRITE(lunout, *)' Configuration des parametres de cel0_limit: ' 869 WRITE(lunout, *)' planet_type = ', planet_type 870 WRITE(lunout, *)' calend = ', calend 871 WRITE(lunout, *)' dayref = ', dayref 872 WRITE(lunout, *)' anneeref = ', anneeref 873 WRITE(lunout, *)' nday = ', nday 874 WRITE(lunout, *)' day_step = ', day_step 875 WRITE(lunout, *)' iperiod = ', iperiod 876 WRITE(lunout, *)' iconser = ', iconser 877 WRITE(lunout, *)' iecri = ', iecri 878 WRITE(lunout, *)' periodav = ', periodav 879 WRITE(lunout, *)' output_grads_dyn = ', output_grads_dyn 880 WRITE(lunout, *)' dissip_period = ', dissip_period 881 WRITE(lunout, *)' lstardis = ', lstardis 882 WRITE(lunout, *)' nitergdiv = ', nitergdiv 883 WRITE(lunout, *)' nitergrot = ', nitergrot 884 WRITE(lunout, *)' niterh = ', niterh 885 WRITE(lunout, *)' tetagdiv = ', tetagdiv 886 WRITE(lunout, *)' tetagrot = ', tetagrot 887 WRITE(lunout, *)' tetatemp = ', tetatemp 888 WRITE(lunout, *)' coefdis = ', coefdis 889 WRITE(lunout, *)' purmats = ', purmats 890 WRITE(lunout, *)' read_start = ', read_start 891 WRITE(lunout, *)' iflag_phys = ', iflag_phys 892 WRITE(lunout, *)' iphysiq = ', iphysiq 893 WRITE(lunout, *)' clon = ', clon 894 WRITE(lunout, *)' clat = ', clat 895 WRITE(lunout, *)' grossismx = ', grossismx 896 WRITE(lunout, *)' grossismy = ', grossismy 897 WRITE(lunout, *)' fxyhypb = ', fxyhypb 898 WRITE(lunout, *)' dzoomx = ', dzoomx 899 WRITE(lunout, *)' dzoomy = ', dzoomy 900 WRITE(lunout, *)' taux = ', taux 901 WRITE(lunout, *)' tauy = ', tauy 902 WRITE(lunout, *)' offline = ', offline 903 WRITE(lunout, *)' type_trac = ', type_trac 904 WRITE(lunout, *)' ok_dynzon = ', ok_dynzon 905 WRITE(lunout, *)' ok_dyn_ins = ', ok_dyn_ins 906 WRITE(lunout, *)' ok_dyn_ave = ', ok_dyn_ave 907 WRITE(lunout, *)' ok_strato = ', ok_strato 908 WRITE(lunout, *)' ok_gradsfile = ', ok_gradsfile 909 WRITE(lunout, *)' ok_limit = ', ok_limit 910 WRITE(lunout, *)' ok_etat0 = ', ok_etat0 911 WRITE(lunout, *)' ok_guide = ', ok_guide 912 WRITE(lunout, *)' read_orop = ', read_orop 913 913 ENDIF test_etatinit 914 914 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/dynetat0.F90
r5114 r5116 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 162 write(*,*) 'attention dans dynetat0: les alpha_ideal sont a 1'162 WRITE(*,*) 'attention dans dynetat0: les alpha_ideal sont a 1' 163 163 else 164 164 IF(getKey('tnat', tnat, isoName(iName)) .OR. getKey('alpha', alpha_ideal, isoName(iName))) & -
LMDZ6/branches/Amaury_dev/libf/dyn3d/fluxstokenc.F90
r5105 r5116 31 31 32 32 REAL :: pbarvst(iip1, jjp1, llm), zistdyn 33 real:: dtcum33 REAL :: dtcum 34 34 35 35 INTEGER :: iadvtr, ndex(1) 36 integer:: nscal37 real:: tst(1), ist(1), istp(1)36 INTEGER :: nscal 37 REAL :: tst(1), ist(1), istp(1) 38 38 INTEGER :: ij, l, irec, i, j, itau 39 39 INTEGER, SAVE :: fluxid, fluxvid, fluxdid … … 52 52 wg(:, :) = 0. 53 53 54 if(first) then 55 54 IF(first) THEN 56 55 CALL initfluxsto('fluxstoke', & 57 56 time_step, istdyn * time_step, istdyn * time_step, & … … 134 133 135 134 iadvtr = 0 136 write(lunout, *)'ITAU auquel on stoke les fluxmasses', itau135 WRITE(lunout, *)'ITAU auquel on stoke les fluxmasses', itau 137 136 138 137 CALL histwrite(fluxid, 'masse', itau, massem, & -
LMDZ6/branches/Amaury_dev/libf/dyn3d/friction.F90
r5113 r5116 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 write(lunout, *)'Friction: wrong friction type', friction_type51 WRITE(lunout, *)'Friction: wrong friction type', friction_type 52 52 CALL abort_gcm(modname, abort_message, 42) 53 53 endif … … 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 … … 118 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)) -
LMDZ6/branches/Amaury_dev/libf/dyn3d/gcm.F90
r5114 r5116 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 write(lunout,*)'CALENDRIER CHOISI: Terrestre a 360 jours/an'172 else if (calend == 'earth_365d') then171 WRITE(lunout,*)'CALENDRIER CHOISI: Terrestre a 360 jours/an' 172 else if (calend == 'earth_365d') THEN 173 173 CALL ioconf_calendar('noleap') 174 write(lunout,*)'CALENDRIER CHOISI: Terrestre a 365 jours/an'175 else if (calend == 'gregorian') then174 WRITE(lunout,*)'CALENDRIER CHOISI: Terrestre a 365 jours/an' 175 else if (calend == 'gregorian') THEN 176 176 CALL ioconf_calendar('gregorian') 177 write(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile'177 WRITE(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile' 178 178 else 179 179 abort_message = 'Mauvais choix de calendrier' … … 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, & … … 216 216 ! endif ! of if (planet_type.eq."earth") 217 217 218 ! write(73,*) 'ucov',ucov219 ! write(74,*) 'vcov',vcov220 ! write(75,*) 'teta',teta221 ! write(76,*) 'ps',ps222 ! write(77,*) 'q',q218 ! WRITE(73,*) 'ucov',ucov 219 ! WRITE(74,*) 'vcov',vcov 220 ! WRITE(75,*) 'teta',teta 221 ! WRITE(76,*) 'ps',ps 222 ! WRITE(77,*) 'q',q 223 223 224 224 endif ! of if (read_start) … … 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 … … 260 260 ! on remet le calendrier \`a zero si demande 261 261 262 IF (start_time /= starttime) then262 IF (start_time /= starttime) THEN 263 263 WRITE(lunout,*)' GCM: Attention l''heure de depart lue dans le' & 264 264 ,' fichier restart ne correspond pas a celle lue dans le run.def' 265 IF (raz_date == 1) then265 IF (raz_date == 1) THEN 266 266 WRITE(lunout,*)'Je prends l''heure lue dans run.def' 267 267 start_time = starttime … … 277 277 itau_phy = 0 278 278 time_0 = 0. 279 write(lunout,*) &279 WRITE(lunout,*) & 280 280 'GCM: On reinitialise a la date lue dans gcm.def' 281 281 ELSE IF (annee_ref /= anneeref .or. day_ref /= dayref) THEN 282 write(lunout,*) &282 WRITE(lunout,*) & 283 283 'GCM: Attention les dates initiales lues dans le fichier' 284 write(lunout,*) &284 WRITE(lunout,*) & 285 285 ' restart ne correspondent pas a celles lues dans ' 286 write(lunout,*)' gcm.def'287 write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref288 write(lunout,*)' day_ref=',day_ref," dayref=",dayref289 write(lunout,*)' Pas de remise a zero'290 ENDIF 291 292 ! if (annee_ref .ne. anneeref .or. day_ref .ne. dayref) then293 ! write(lunout,*)286 WRITE(lunout,*)' gcm.def' 287 WRITE(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref 288 WRITE(lunout,*)' day_ref=',day_ref," dayref=",dayref 289 WRITE(lunout,*)' Pas de remise a zero' 290 ENDIF 291 292 ! if (annee_ref .ne. anneeref .or. day_ref .ne. dayref) THEN 293 ! WRITE(lunout,*) 294 294 ! . 'GCM: Attention les dates initiales lues dans le fichier' 295 ! write(lunout,*)295 ! WRITE(lunout,*) 296 296 ! . ' restart ne correspondent pas a celles lues dans ' 297 ! write(lunout,*)' gcm.def'298 ! write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref299 ! write(lunout,*)' day_ref=',day_ref," dayref=",dayref300 ! if (raz_date .ne. 1) then301 ! write(lunout,*)297 ! WRITE(lunout,*)' gcm.def' 298 ! WRITE(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref 299 ! WRITE(lunout,*)' day_ref=',day_ref," dayref=",dayref 300 ! if (raz_date .ne. 1) THEN 301 ! WRITE(lunout,*) 302 302 ! . 'GCM: On garde les dates du fichier restart' 303 303 ! else … … 308 308 ! itau_phy = 0 309 309 ! time_0 = 0. 310 ! write(lunout,*)310 ! WRITE(lunout,*) 311 311 ! . 'GCM: On reinitialise a la date lue dans gcm.def' 312 312 ! endif … … 323 323 CALL ioconf_startdate(INT(jD_ref), jH_ref) 324 324 325 write(lunout,*)'DEBUG'326 write(lunout,*)'annee_ref, mois, day_ref, heure, jD_ref'327 write(lunout,*)annee_ref, mois, day_ref, heure, jD_ref325 WRITE(lunout,*)'DEBUG' 326 WRITE(lunout,*)'annee_ref, mois, day_ref, heure, jD_ref' 327 WRITE(lunout,*)annee_ref, mois, day_ref, heure, jD_ref 328 328 CALL ju2ymds(jD_ref+jH_ref,an, mois, jour, heure) 329 write(lunout,*)'jD_ref+jH_ref,an, mois, jour, heure'330 write(lunout,*)jD_ref+jH_ref,an, mois, jour, heure331 332 333 if (iflag_phys==1) then329 WRITE(lunout,*)'jD_ref+jH_ref,an, mois, jour, heure' 330 WRITE(lunout,*)jD_ref+jH_ref,an, mois, jour, heure 331 332 333 if (iflag_phys==1) THEN 334 334 ! these initialisations have already been done (via iniacademic) 335 335 ! if running in SW or Newtonian mode … … 365 365 366 366 367 if (nday>=0) then367 if (nday>=0) THEN 368 368 day_end = day_ini + nday 369 369 else … … 395 395 ENDIF ! of IF ((iflag_phys==1).or.(iflag_phys>=100)) 396 396 397 ! if (planet_type.eq."earth") then397 ! 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 … … 432 432 ! ---------------------------------- 433 433 434 ! write(78,*) 'ucov',ucov435 ! write(78,*) 'vcov',vcov436 ! write(78,*) 'teta',teta437 ! write(78,*) 'ps',ps438 ! write(78,*) 'q',q434 ! WRITE(78,*) 'ucov',ucov 435 ! WRITE(78,*) 'vcov',vcov 436 ! WRITE(78,*) 'teta',teta 437 ! WRITE(78,*) 'ps',ps 438 ! WRITE(78,*) 'q',q 439 439 440 440 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/getparam.F90
r5113 r5116 46 46 CALL getin(TARGET,ret_val) 47 47 48 write(out_eff,*) '######################################'49 write(out_eff,*) '#### ',comment,' #####'50 write(out_eff,*) TARGET,'=',ret_val48 WRITE(out_eff,*) '######################################' 49 WRITE(out_eff,*) '#### ',comment,' #####' 50 WRITE(out_eff,*) TARGET,'=',ret_val 51 51 52 52 END SUBROUTINE getparamr … … 69 69 CALL getin(TARGET,ret_val) 70 70 71 write(out_eff,*) '######################################'72 write(out_eff,*) '#### ',comment,' #####'73 write(out_eff,*) comment74 write(out_eff,*) TARGET,'=',ret_val71 WRITE(out_eff,*) '######################################' 72 WRITE(out_eff,*) '#### ',comment,' #####' 73 WRITE(out_eff,*) comment 74 WRITE(out_eff,*) TARGET,'=',ret_val 75 75 76 76 END SUBROUTINE getparami … … 93 93 CALL getin(TARGET,ret_val) 94 94 95 write(out_eff,*) '######################################'96 write(out_eff,*) '#### ',comment,' #####'97 write(out_eff,*) TARGET,'=',ret_val95 WRITE(out_eff,*) '######################################' 96 WRITE(out_eff,*) '#### ',comment,' #####' 97 WRITE(out_eff,*) TARGET,'=',ret_val 98 98 99 99 END SUBROUTINE getparaml -
LMDZ6/branches/Amaury_dev/libf/dyn3d/groupe.F90
r5113 r5116 3 3 SUBROUTINE groupe(pext, pbaru, pbarv, pbarum, pbarvm, wm) 4 4 5 use comconst_mod, only: ngroup5 use comconst_mod, ONLY: ngroup 6 6 7 7 IMPLICIT NONE … … 25 25 ! parameter (ngroup=3) 26 26 27 real:: pbaru(iip1, jjp1, llm), pbarv(iip1, jjm, llm)28 real:: pext(iip1, jjp1, llm)27 REAL :: pbaru(iip1, jjp1, llm), pbarv(iip1, jjm, llm) 28 REAL :: pext(iip1, jjp1, llm) 29 29 30 real:: pbarum(iip1, jjp1, llm), pbarvm(iip1, jjm, llm)31 real:: wm(iip1, jjp1, llm)30 REAL :: pbarum(iip1, jjp1, llm), pbarvm(iip1, jjm, llm) 31 REAL :: wm(iip1, jjp1, llm) 32 32 33 real:: zconvm(iip1, jjp1, llm), zconvmm(iip1, jjp1, llm)33 REAL :: zconvm(iip1, jjp1, llm), zconvmm(iip1, jjp1, llm) 34 34 35 real:: uu35 REAL :: uu 36 36 37 integer:: i, j, l37 INTEGER :: i, j, l 38 38 39 39 logical :: firstcall, groupe_ok … … 43 43 data groupe_ok/.TRUE./ 44 44 45 if (iim==1) then45 if (iim==1) THEN 46 46 groupe_ok = .FALSE. 47 47 endif 48 48 49 if (firstcall) then50 if (groupe_ok) then51 if(mod(iim, 2**ngroup)/=0) &49 if (firstcall) THEN 50 if (groupe_ok) THEN 51 IF(mod(iim, 2**ngroup)/=0) & 52 52 CALL abort_gcm('groupe', 'probleme du nombre de point', 1) 53 53 endif … … 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) -
LMDZ6/branches/Amaury_dev/libf/dyn3d/guide_mod.F90
r5113 r5116 72 72 SUBROUTINE guide_init 73 73 74 use netcdf, only: nf90_noerr74 use netcdf, ONLY: nf90_noerr 75 75 USE control_mod, ONLY: day_step 76 76 USE serre_mod, ONLY: grossismx … … 127 127 IF (iguide_sav>0) THEN 128 128 iguide_sav=day_step/iguide_sav 129 ELSE if (iguide_sav == 0) then129 ELSE if (iguide_sav == 0) THEN 130 130 iguide_sav = huge(0) 131 131 ELSE … … 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 178 if (rcod/=nf90_noerr) THEN … … 181 181 endif 182 182 endif 183 elseif (guide_plevs==2) then184 if (ncidpl==-99) then183 elseif (guide_plevs==2) THEN 184 if (ncidpl==-99) THEN 185 185 rcod=nf90_open('P.nc',nf90_nowrite,ncidpl) 186 186 if (rcod/=nf90_noerr) THEN … … 190 190 endif 191 191 192 elseif (guide_u) then193 if (ncidpl==-99) then192 elseif (guide_u) THEN 193 if (ncidpl==-99) THEN 194 194 rcod=nf90_open('u.nc',nf90_nowrite,ncidpl) 195 195 if (rcod/=nf90_noerr) THEN … … 199 199 endif 200 200 201 elseif (guide_v) then202 if (ncidpl==-99) then201 elseif (guide_v) THEN 202 if (ncidpl==-99) THEN 203 203 rcod=nf90_open('v.nc',nf90_nowrite,ncidpl) 204 204 if (rcod/=nf90_noerr) THEN … … 207 207 endif 208 208 endif 209 elseif (guide_T) then210 if (ncidpl==-99) then209 elseif (guide_T) THEN 210 if (ncidpl==-99) THEN 211 211 rcod=nf90_open('T.nc',nf90_nowrite,ncidpl) 212 212 if (rcod/=nf90_noerr) THEN … … 215 215 endif 216 216 endif 217 elseif (guide_Q) then218 if (ncidpl==-99) then217 elseif (guide_Q) THEN 218 if (ncidpl==-99) THEN 219 219 rcod=nf90_open('hur.nc',nf90_nowrite, ncidpl) 220 220 if (rcod/=nf90_noerr) THEN … … 232 232 ENDIF 233 233 error=nf90_inquire_dimension(ncidpl,rid,len=nlevnc) 234 write(*,*)trim(modname)//' : number of vertical levels nlevnc', nlevnc234 WRITE(*,*)trim(modname)//' : number of vertical levels nlevnc', nlevnc 235 235 rcod = nf90_close(ncidpl) 236 236 … … 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 … … 453 453 IF (reste==0.) THEN 454 454 IF (itau_test==itau) THEN 455 write(lunout,*)trim(modname)//' second pass in advreel at itau=',&455 WRITE(lunout,*)trim(modname)//' second pass in advreel at itau=',& 456 456 itau 457 457 abort_message='stopped' … … 466 466 step_rea=step_rea+1 467 467 itau_test=itau 468 write(*,*)trim(modname)//' Reading nudging files, step ',&468 WRITE(*,*)trim(modname)//' Reading nudging files, step ',& 469 469 step_rea,'after ',count_no_rea,' skips' 470 470 IF (guide_2D) THEN … … 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 … … 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 … … 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 … … 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 … … 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 … … 670 670 SUBROUTINE guide_interp(psi,teta) 671 671 672 use exner_hyb_m, only: exner_hyb673 use exner_milieu_m, only: exner_milieu674 use comconst_mod, only: kappa, cpp675 use comvert_mod, only: preff, pressure_exner, bp, ap672 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 676 IMPLICIT NONE 677 677 … … 705 705 CHARACTER(LEN=20),PARAMETER :: modname="guide_interp" 706 706 707 write(*,*)trim(modname)//': interpolate nudging variables'707 WRITE(*,*)trim(modname)//': interpolate nudging variables' 708 708 ! ----------------------------------------------------------------- 709 709 ! Calcul des niveaux de pression champs guidage 710 710 ! ----------------------------------------------------------------- 711 IF (guide_modele) then711 IF (guide_modele) THEN 712 712 do i=1,iip1 713 713 do j=1,jjp1 … … 729 729 730 730 END IF 731 if (first) then731 if (first) THEN 732 732 first=.FALSE. 733 write(*,*)trim(modname)//' : check vertical level order'734 write(*,*)trim(modname)//' LMDZ :'733 WRITE(*,*)trim(modname)//' : check vertical level order' 734 WRITE(*,*)trim(modname)//' LMDZ :' 735 735 do l=1,llm 736 write(*,*)trim(modname)//' PL(',l,')=',(ap(l)+ap(l+1))/2. &736 WRITE(*,*)trim(modname)//' PL(',l,')=',(ap(l)+ap(l+1))/2. & 737 737 +psi(1,jjp1)*(bp(l)+bp(l+1))/2. 738 738 enddo 739 write(*,*)trim(modname)//' nudging file :'739 WRITE(*,*)trim(modname)//' nudging file :' 740 740 do l=1,nlevnc 741 write(*,*)trim(modname)//' PL(',l,')=',plnc2(1,1,l)741 WRITE(*,*)trim(modname)//' PL(',l,')=',plnc2(1,1,l) 742 742 enddo 743 write(*,*)trim(modname)//' invert ordering: invert_p=',invert_p744 if (guide_u) then743 WRITE(*,*)trim(modname)//' invert ordering: invert_p=',invert_p 744 if (guide_u) THEN 745 745 do l=1,nlevnc 746 write(*,*)trim(modname)//' U(',l,')=',unat2(1,1,l)746 WRITE(*,*)trim(modname)//' U(',l,')=',unat2(1,1,l) 747 747 enddo 748 748 endif 749 if (guide_T) then749 if (guide_T) THEN 750 750 do l=1,nlevnc 751 write(*,*)trim(modname)//' T(',l,')=',tnat2(1,1,l)751 WRITE(*,*)trim(modname)//' T(',l,')=',tnat2(1,1,l) 752 752 enddo 753 753 endif … … 758 758 ! ----------------------------------------------------------------- 759 759 CALL pression( ip1jmp1, ap, bp, psi, p ) 760 if (pressure_exner) then760 if (pressure_exner) THEN 761 761 CALL exner_hyb(ip1jmp1,psi,p,pks,pk) 762 762 else … … 803 803 ! Conversion en variables gcm (ucov, vcov...) 804 804 ! ----------------------------------------------------------------- 805 if (guide_P) then805 if (guide_P) THEN 806 806 do j=1,jjp1 807 807 do i=1,iim … … 921 921 ! Calcul des constantes de rappel alpha (=1/tau) 922 922 923 use comconst_mod, only: pi924 use serre_mod, only: clon, clat, grossismx, grossismy923 use comconst_mod, ONLY: pi 924 use serre_mod, ONLY: clon, clat, grossismx, grossismy 925 925 926 926 IMPLICIT NONE … … 948 948 real alphamin,alphamax,xi 949 949 integer i,j,ilon,ilat 950 character(len=20),parameter :: modname="tau2alpha"950 CHARACTER(LEN=20),parameter :: modname="tau2alpha" 951 951 CHARACTER (len = 80) :: abort_message 952 952 … … 962 962 do j=1,pjm 963 963 do i=1,pim 964 if (typ==2) then964 if (typ==2) THEN 965 965 zlat=rlatu(j)*180./pi 966 966 zlon=rlonu(i)*180./pi 967 elseif (typ==1) then967 elseif (typ==1) THEN 968 968 zlat=rlatu(j)*180./pi 969 969 zlon=rlonv(i)*180./pi 970 elseif (typ==3) then970 elseif (typ==3) THEN 971 971 zlat=rlatv(j)*180./pi 972 972 zlon=rlonv(i)*180./pi … … 1037 1037 enddo 1038 1038 ! Calcul de gamma 1039 if (abs(grossismx-1.)<0.1.or.abs(grossismy-1.)<0.1) then1040 write(*,*)trim(modname)//' ATTENTION modele peu zoome'1041 write(*,*)trim(modname)//' ATTENTION on prend une constante de guidage cste'1039 if (abs(grossismx-1.)<0.1.or.abs(grossismy-1.)<0.1) THEN 1040 WRITE(*,*)trim(modname)//' ATTENTION modele peu zoome' 1041 WRITE(*,*)trim(modname)//' ATTENTION on prend une constante de guidage cste' 1042 1042 gamma=0. 1043 1043 else 1044 1044 gamma=(dxdy_max-2.*dxdy_min)/(dxdy_max-dxdy_min) 1045 write(*,*)trim(modname)//' gamma=',gamma1046 if (gamma<1.e-5) then1047 write(*,*)trim(modname)//' gamma =',gamma,'<1e-5'1045 WRITE(*,*)trim(modname)//' gamma=',gamma 1046 if (gamma<1.e-5) THEN 1047 WRITE(*,*)trim(modname)//' gamma =',gamma,'<1e-5' 1048 1048 abort_message='stopped' 1049 1049 CALL abort_gcm(modname,abort_message,1) 1050 1050 endif 1051 1051 gamma=log(0.5)/log(gamma) 1052 if (gamma4) then1052 if (gamma4) THEN 1053 1053 gamma=min(gamma,4.) 1054 1054 endif 1055 write(*,*)trim(modname)//' gamma=',gamma1055 WRITE(*,*)trim(modname)//' gamma=',gamma 1056 1056 endif 1057 1057 ENDIF !first … … 1059 1059 do j=1,pjm 1060 1060 do i=1,pim 1061 if (typ==1) then1061 if (typ==1) THEN 1062 1062 dxdy_=dxdys(i,j) 1063 1063 zlat=rlatu(j)*180./pi 1064 elseif (typ==2) then1064 elseif (typ==2) THEN 1065 1065 dxdy_=dxdyu(i,j) 1066 1066 zlat=rlatu(j)*180./pi 1067 elseif (typ==3) then1067 elseif (typ==3) THEN 1068 1068 dxdy_=dxdyv(i,j) 1069 1069 zlat=rlatv(j)*180./pi 1070 1070 endif 1071 if (abs(grossismx-1.)<0.1.or.abs(grossismy-1.)<0.1) then1071 if (abs(grossismx-1.)<0.1.or.abs(grossismy-1.)<0.1) THEN 1072 1072 ! pour une grille reguliere, xi=xxx**0=1 -> alpha=alphamin 1073 1073 alpha(i,j)=alphamin … … 1075 1075 xi=((dxdy_max-dxdy_)/(dxdy_max-dxdy_min))**gamma 1076 1076 xi=min(xi,1.) 1077 if(lat_min_g<=zlat .and. zlat<=lat_max_g) then1077 IF(lat_min_g<=zlat .and. zlat<=lat_max_g) THEN 1078 1078 alpha(i,j)=xi*alphamin+(1.-xi)*alphamax 1079 1079 else … … 1113 1113 ! Premier appel: initialisation de la lecture des fichiers 1114 1114 ! ----------------------------------------------------------------- 1115 if (first) then1115 if (first) THEN 1116 1116 ncidpl=-99 1117 write(*,*) trim(modname)//': opening nudging files '1117 WRITE(*,*) trim(modname)//': opening nudging files ' 1118 1118 ! Niveaux de pression si non constants 1119 if (guide_plevs==1) then1120 write(*,*) trim(modname)//' Reading nudging on model levels'1119 if (guide_plevs==1) THEN 1120 WRITE(*,*) trim(modname)//' Reading nudging on model levels' 1121 1121 rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl) 1122 1122 IF (rcode/=nf90_noerr) THEN … … 1134 1134 CALL abort_gcm(modname,abort_message,1) 1135 1135 ENDIF 1136 write(*,*) trim(modname)//' ncidpl,varidap',ncidpl,varidap1136 WRITE(*,*) trim(modname)//' ncidpl,varidap',ncidpl,varidap 1137 1137 endif 1138 1138 1139 1139 ! Pression si guidage sur niveaux P variables 1140 if (guide_plevs==2) then1140 if (guide_plevs==2) THEN 1141 1141 rcode = nf90_open('P.nc', nf90_nowrite, ncidp) 1142 1142 IF (rcode/=nf90_noerr) THEN … … 1149 1149 CALL abort_gcm(modname,abort_message,1) 1150 1150 ENDIF 1151 write(*,*) trim(modname)//' ncidp,varidp',ncidp,varidp1151 WRITE(*,*) trim(modname)//' ncidp,varidp',ncidp,varidp 1152 1152 if (ncidpl==-99) ncidpl=ncidp 1153 1153 endif 1154 1154 1155 1155 ! Vent zonal 1156 if (guide_u) then1156 if (guide_u) THEN 1157 1157 rcode = nf90_open('u.nc', nf90_nowrite, ncidu) 1158 1158 IF (rcode/=nf90_noerr) THEN … … 1165 1165 CALL abort_gcm(modname,abort_message,1) 1166 1166 ENDIF 1167 write(*,*) trim(modname)//' ncidu,varidu',ncidu,varidu1167 WRITE(*,*) trim(modname)//' ncidu,varidu',ncidu,varidu 1168 1168 if (ncidpl==-99) ncidpl=ncidu 1169 1169 … … 1185 1185 1186 1186 ! Vent meridien 1187 if (guide_v) then1187 if (guide_v) THEN 1188 1188 rcode = nf90_open('v.nc', nf90_nowrite, ncidv) 1189 1189 IF (rcode/=nf90_noerr) THEN … … 1196 1196 CALL abort_gcm(modname,abort_message,1) 1197 1197 ENDIF 1198 write(*,*) trim(modname)//' ncidv,varidv',ncidv,varidv1198 WRITE(*,*) trim(modname)//' ncidv,varidv',ncidv,varidv 1199 1199 if (ncidpl==-99) ncidpl=ncidv 1200 1200 … … 1218 1218 1219 1219 ! Temperature 1220 if (guide_T) then1220 if (guide_T) THEN 1221 1221 rcode = nf90_open('T.nc', nf90_nowrite, ncidt) 1222 1222 IF (rcode/=nf90_noerr) THEN … … 1229 1229 CALL abort_gcm(modname,abort_message,1) 1230 1230 ENDIF 1231 write(*,*) trim(modname)//' ncidT,varidT',ncidt,varidt1231 WRITE(*,*) trim(modname)//' ncidT,varidT',ncidt,varidt 1232 1232 if (ncidpl==-99) ncidpl=ncidt 1233 1233 … … 1249 1249 1250 1250 ! Humidite 1251 if (guide_Q) then1251 if (guide_Q) THEN 1252 1252 rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ) 1253 1253 IF (rcode/=nf90_noerr) THEN … … 1260 1260 CALL abort_gcm(modname,abort_message,1) 1261 1261 ENDIF 1262 write(*,*) trim(modname)//' ncidQ,varidQ',ncidQ,varidQ1262 WRITE(*,*) trim(modname)//' ncidQ,varidQ',ncidQ,varidQ 1263 1263 if (ncidpl==-99) ncidpl=ncidQ 1264 1264 … … 1280 1280 1281 1281 ! Pression de surface 1282 if ((guide_P).OR.(guide_modele)) then1282 if ((guide_P).OR.(guide_modele)) THEN 1283 1283 rcode = nf90_open('ps.nc', nf90_nowrite, ncidps) 1284 1284 IF (rcode/=nf90_noerr) THEN … … 1291 1291 CALL abort_gcm(modname,abort_message,1) 1292 1292 ENDIF 1293 write(*,*) trim(modname)//' ncidps,varidps',ncidps,varidps1293 WRITE(*,*) trim(modname)//' ncidps,varidps',ncidps,varidps 1294 1294 endif 1295 1295 ! Coordonnee verticale 1296 if (guide_plevs==0) then1296 if (guide_plevs==0) THEN 1297 1297 rcode = nf90_inq_varid(ncidpl, 'LEVEL', varidpl) 1298 1298 IF (rcode/=0) rcode = nf90_inq_varid(ncidpl, 'PRESSURE', varidpl) 1299 write(*,*) trim(modname)//' ncidpl,varidpl',ncidpl,varidpl1299 WRITE(*,*) trim(modname)//' ncidpl,varidpl',ncidpl,varidpl 1300 1300 endif 1301 1301 ! Coefs ap, bp pour calcul de la pression aux differents niveaux 1302 if (guide_plevs==1) then1302 if (guide_plevs==1) THEN 1303 1303 status=nf90_get_var(ncidpl,varidap,apnc,[1],[nlevnc]) 1304 1304 status=nf90_get_var(ncidpl,varidbp,bpnc,[1],[nlevnc]) … … 1328 1328 1329 1329 ! Pression 1330 if (guide_plevs==2) then1330 if (guide_plevs==2) THEN 1331 1331 status=nf90_get_var(ncidp,varidp,pnat2,start,count) 1332 1332 IF (invert_y) THEN … … 1338 1338 1339 1339 ! Vent zonal 1340 if (guide_u) then1340 if (guide_u) THEN 1341 1341 status=nf90_get_var(ncidu,varidu,unat2,start,count) 1342 1342 IF (invert_y) THEN … … 1346 1346 1347 1347 ! Temperature 1348 if (guide_T) then1348 if (guide_T) THEN 1349 1349 status=nf90_get_var(ncidt,varidt,tnat2,start,count) 1350 1350 IF (invert_y) THEN … … 1354 1354 1355 1355 ! Humidite 1356 if (guide_Q) then1356 if (guide_Q) THEN 1357 1357 status=nf90_get_var(ncidQ,varidQ,qnat2,start,count) 1358 1358 IF (invert_y) THEN … … 1363 1363 1364 1364 ! Vent meridien 1365 if (guide_v) then1365 if (guide_v) THEN 1366 1366 count(2)=jjm 1367 1367 status=nf90_get_var(ncidv,varidv,vnat2,start,count) … … 1372 1372 1373 1373 ! Pression de surface 1374 if ((guide_P).OR.(guide_modele)) then1374 if ((guide_P).OR.(guide_modele)) THEN 1375 1375 start(3)=timestep 1376 1376 start(4)=0 … … 1413 1413 ! Premier appel: initialisation de la lecture des fichiers 1414 1414 ! ----------------------------------------------------------------- 1415 if (first) then1415 if (first) THEN 1416 1416 ncidpl=-99 1417 write(*,*)trim(modname)//' : opening nudging files '1417 WRITE(*,*)trim(modname)//' : opening nudging files ' 1418 1418 ! Ap et Bp si niveaux de pression hybrides 1419 if (guide_plevs==1) then1420 write(*,*)trim(modname)//' Reading nudging on model levels'1419 if (guide_plevs==1) THEN 1420 WRITE(*,*)trim(modname)//' Reading nudging on model levels' 1421 1421 rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl) 1422 1422 IF (rcode/=nf90_noerr) THEN … … 1434 1434 CALL abort_gcm(modname,abort_message,1) 1435 1435 ENDIF 1436 write(*,*)trim(modname)//'ncidpl,varidap',ncidpl,varidap1436 WRITE(*,*)trim(modname)//'ncidpl,varidap',ncidpl,varidap 1437 1437 endif 1438 1438 ! Pression 1439 if (guide_plevs==2) then1439 if (guide_plevs==2) THEN 1440 1440 rcode = nf90_open('P.nc', nf90_nowrite, ncidp) 1441 1441 IF (rcode/=nf90_noerr) THEN … … 1448 1448 CALL abort_gcm(modname,abort_message,1) 1449 1449 ENDIF 1450 write(*,*)trim(modname)//' ncidp,varidp',ncidp,varidp1450 WRITE(*,*)trim(modname)//' ncidp,varidp',ncidp,varidp 1451 1451 if (ncidpl==-99) ncidpl=ncidp 1452 1452 endif 1453 1453 ! Vent zonal 1454 if (guide_u) then1454 if (guide_u) THEN 1455 1455 rcode = nf90_open('u.nc', nf90_nowrite, ncidu) 1456 1456 IF (rcode/=nf90_noerr) THEN … … 1463 1463 CALL abort_gcm(modname,abort_message,1) 1464 1464 ENDIF 1465 write(*,*)trim(modname)//' ncidu,varidu',ncidu,varidu1465 WRITE(*,*)trim(modname)//' ncidu,varidu',ncidu,varidu 1466 1466 if (ncidpl==-99) ncidpl=ncidu 1467 1467 endif 1468 1468 ! Vent meridien 1469 if (guide_v) then1469 if (guide_v) THEN 1470 1470 rcode = nf90_open('v.nc', nf90_nowrite, ncidv) 1471 1471 IF (rcode/=nf90_noerr) THEN … … 1478 1478 CALL abort_gcm(modname,abort_message,1) 1479 1479 ENDIF 1480 write(*,*)trim(modname)//' ncidv,varidv',ncidv,varidv1480 WRITE(*,*)trim(modname)//' ncidv,varidv',ncidv,varidv 1481 1481 if (ncidpl==-99) ncidpl=ncidv 1482 1482 endif 1483 1483 ! Temperature 1484 if (guide_T) then1484 if (guide_T) THEN 1485 1485 rcode = nf90_open('T.nc', nf90_nowrite, ncidt) 1486 1486 IF (rcode/=nf90_noerr) THEN … … 1493 1493 CALL abort_gcm(modname,abort_message,1) 1494 1494 ENDIF 1495 write(*,*)trim(modname)//' ncidT,varidT',ncidt,varidt1495 WRITE(*,*)trim(modname)//' ncidT,varidT',ncidt,varidt 1496 1496 if (ncidpl==-99) ncidpl=ncidt 1497 1497 endif 1498 1498 ! Humidite 1499 if (guide_Q) then1499 if (guide_Q) THEN 1500 1500 rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ) 1501 1501 IF (rcode/=nf90_noerr) THEN … … 1508 1508 CALL abort_gcm(modname,abort_message,1) 1509 1509 ENDIF 1510 write(*,*)trim(modname)//' ncidQ,varidQ',ncidQ,varidQ1510 WRITE(*,*)trim(modname)//' ncidQ,varidQ',ncidQ,varidQ 1511 1511 if (ncidpl==-99) ncidpl=ncidQ 1512 1512 endif 1513 1513 ! Pression de surface 1514 if ((guide_P).OR.(guide_modele)) then1514 if ((guide_P).OR.(guide_modele)) THEN 1515 1515 rcode = nf90_open('ps.nc', nf90_nowrite, ncidps) 1516 1516 IF (rcode/=nf90_noerr) THEN … … 1523 1523 CALL abort_gcm(modname,abort_message,1) 1524 1524 ENDIF 1525 write(*,*)trim(modname)//' ncidps,varidps',ncidps,varidps1525 WRITE(*,*)trim(modname)//' ncidps,varidps',ncidps,varidps 1526 1526 endif 1527 1527 ! Coordonnee verticale 1528 if (guide_plevs==0) then1528 if (guide_plevs==0) THEN 1529 1529 rcode = nf90_inq_varid(ncidpl, 'LEVEL', varidpl) 1530 1530 IF (rcode/=0) rcode = nf90_inq_varid(ncidpl, 'PRESSURE', varidpl) 1531 write(*,*)trim(modname)//' ncidpl,varidpl',ncidpl,varidpl1531 WRITE(*,*)trim(modname)//' ncidpl,varidpl',ncidpl,varidpl 1532 1532 endif 1533 1533 ! Coefs ap, bp pour calcul de la pression aux differents niveaux 1534 if (guide_plevs==1) then1534 if (guide_plevs==1) THEN 1535 1535 status=nf90_get_var(ncidpl,varidap,apnc,[1],[nlevnc]) 1536 1536 status=nf90_get_var(ncidpl,varidbp,bpnc,[1],[nlevnc]) … … 1559 1559 1560 1560 ! Pression 1561 if (guide_plevs==2) then1561 if (guide_plevs==2) THEN 1562 1562 status=nf90_get_var(ncidp,varidp,zu,start,count) 1563 1563 DO i=1,iip1 … … 1572 1572 endif 1573 1573 ! Vent zonal 1574 if (guide_u) then1574 if (guide_u) THEN 1575 1575 status=nf90_get_var(ncidu,varidu,zu,start,count) 1576 1576 DO i=1,iip1 … … 1585 1585 1586 1586 ! Temperature 1587 if (guide_T) then1587 if (guide_T) THEN 1588 1588 status=nf90_get_var(ncidt,varidt,zu,start,count) 1589 1589 DO i=1,iip1 … … 1598 1598 1599 1599 ! Humidite 1600 if (guide_Q) then1600 if (guide_Q) THEN 1601 1601 status=nf90_get_var(ncidQ,varidQ,zu,start,count) 1602 1602 DO i=1,iip1 … … 1611 1611 1612 1612 ! Vent meridien 1613 if (guide_v) then1613 if (guide_v) THEN 1614 1614 count(2)=jjm 1615 1615 status=nf90_get_var(ncidv,varidv,zv,start,count) … … 1625 1625 1626 1626 ! Pression de surface 1627 if ((guide_P).OR.(guide_plevs==1)) then1627 if ((guide_P).OR.(guide_plevs==1)) THEN 1628 1628 start(3)=timestep 1629 1629 start(4)=0 … … 1674 1674 CHARACTER(LEN=20),PARAMETER :: modname="guide_out" 1675 1675 1676 write(*,*)trim(modname)//': output timestep',timestep,'var ',varname1676 WRITE(*,*)trim(modname)//': output timestep',timestep,'var ',varname 1677 1677 IF (timestep==0) THEN 1678 1678 ! ---------------------------------------------- … … 1804 1804 do l=1,nl 1805 1805 do i=2,iim-1 1806 if(abs(x(i,l))>1.e10) then1806 IF(abs(x(i,l))>1.e10) THEN 1807 1807 zz=0.5*(x(i-1,l)+x(i+1,l)) 1808 1808 PRINT*,'correction ',i,l,x(i,l),zz -
LMDZ6/branches/Amaury_dev/libf/dyn3d/iniacademic.F90
r5106 r5116 7 7 USE infotrac, ONLY: nqtot, niso, iqIsoPha, tracers, getKey, isoName 8 8 USE control_mod, ONLY: day_step,planet_type 9 use exner_hyb_m, only: exner_hyb10 use exner_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 12 USE Write_Field … … 60 60 INTEGER i,j,l,lsup,ij, iq, iName, iPhase, iqParent 61 61 62 integer:: nid_relief,varid,ierr62 INTEGER :: nid_relief,varid,ierr 63 63 real, dimension(iip1,jjp1) :: relief 64 64 … … 75 75 LOGICAL,PARAMETER :: tnat1=.TRUE. 76 76 77 character(len=*),parameter :: modname="iniacademic"78 character(len=80) :: abort_message77 CHARACTER(LEN=*),parameter :: modname="iniacademic" 78 CHARACTER(LEN=80) :: abort_message 79 79 80 80 ! Sanity check: verify that options selected by user are not incompatible 81 if ((iflag_phys==1).and. .not. read_start) then82 write(lunout,*) trim(modname)," error: if read_start is set to ", &81 if ((iflag_phys==1).and. .not. read_start) THEN 82 WRITE(lunout,*) trim(modname)," error: if read_start is set to ", & 83 83 " false then iflag_phys should not be 1" 84 write(lunout,*) "You most likely want an aquaplanet initialisation", &84 WRITE(lunout,*) "You most likely want an aquaplanet initialisation", & 85 85 " (iflag_phys >= 100)" 86 86 CALL abort_gcm(modname,"incompatible iflag_phys==1 and read_start==.FALSE.",1) … … 109 109 ang0 = 0. 110 110 111 if (llm == 1) then111 if (llm == 1) THEN 112 112 ! specific initializations for the shallow water case 113 113 kappa=1 … … 164 164 CALL pression ( ip1jmp1, ap, bp, ps, p ) 165 165 166 if (pressure_exner) then166 if (pressure_exner) THEN 167 167 CALL exner_hyb( ip1jmp1, ps, p, pks, pk) 168 168 else … … 172 172 ENDIF 173 173 174 if (llm == 1) then174 if (llm == 1) THEN 175 175 ! initialize fields for the shallow water case, if required 176 if (.not.read_start) then176 if (.not.read_start) THEN 177 177 phis(:)=0. 178 178 q(:,:,:)=0 … … 181 181 endif 182 182 183 academic_case: if (iflag_phys >= 2) then183 academic_case: if (iflag_phys >= 2) THEN 184 184 ! initializations 185 185 … … 249 249 tetajl(j,l)=teta0-delt_y*ddsin*ddsin+eps*ddsin & 250 250 -delt_z*(1.-ddsin*ddsin)*log(zsig) 251 if (planet_type=="giant") then251 if (planet_type=="giant") THEN 252 252 tetajl(j,l)=teta0+(delt_y* & 253 253 ((sin(rlatu(j)*3.14159*eps+0.0001))**2) & … … 293 293 294 294 ! winds 295 if (ok_geost) then295 if (ok_geost) THEN 296 296 CALL ugeostr(phi,ucov) 297 297 else … … 301 301 302 302 ! bulk initialization of tracers 303 if (planet_type=="earth") then303 if (planet_type=="earth") THEN 304 304 ! Earth: first two tracers will be water 305 305 do iq=1,nqtot … … 315 315 iqParent = tracers(iq)%iqParent 316 316 IF(tracers(iq)%iso_iZone == 0) THEN 317 if (tnat1) then317 if (tnat1) THEN 318 318 tnat=1.0 319 319 alpha_ideal=1.0 320 write(*,*) 'Attention dans iniacademic: alpha_ideal=1'320 WRITE(*,*) 'Attention dans iniacademic: alpha_ideal=1' 321 321 else 322 322 IF(getKey('tnat', tnat, isoName(iName)) .OR. getKey('alpha', alpha_ideal, isoName(iName))) & -
LMDZ6/branches/Amaury_dev/libf/dyn3d/iniinterp_horiz.F90
r5113 r5116 32 32 ! """"""""" 33 33 ! INPUT 34 integer:: imo, jmo ! dimensions ancienne grille35 integer:: imn, jmn ! dimensions nouvelle grille36 integer:: kllm ! taille du tableau des intersections37 real:: rlonuo(imo + 1) ! Latitude et38 real:: rlatvo(jmo) ! longitude des39 real:: rlonun(imn + 1) ! bord des40 real:: rlatvn(jmn) ! cases "scalaires" (input)34 INTEGER :: imo, jmo ! dimensions ancienne grille 35 INTEGER :: imn, jmn ! dimensions nouvelle grille 36 INTEGER :: kllm ! taille du tableau des intersections 37 REAL :: rlonuo(imo + 1) ! Latitude et 38 REAL :: rlatvo(jmo) ! longitude des 39 REAL :: rlonun(imn + 1) ! bord des 40 REAL :: rlatvn(jmn) ! cases "scalaires" (input) 41 41 42 42 ! OUTPUT 43 integer:: ktotal ! nombre totale d'intersections reperees44 integer:: iik(kllm), jjk(kllm), jk(kllm), ik(kllm)45 real:: intersec(kllm) ! surface des intersections (m2)46 real:: airen (imn + 1, jmn + 1) ! aire dans la nouvelle grille43 INTEGER :: ktotal ! nombre totale d'intersections reperees 44 INTEGER :: iik(kllm), jjk(kllm), jk(kllm), ik(kllm) 45 REAL :: intersec(kllm) ! surface des intersections (m2) 46 REAL :: airen (imn + 1, jmn + 1) ! aire dans la nouvelle grille 47 47 48 48 … … 51 51 ! Autres variables 52 52 ! """""""""""""""" 53 integer:: i, j, ii, jj, k54 real:: a(imo + 1), b(imo + 1), c(jmo + 1), d(jmo + 1)55 real:: an(imn + 1), bn(imn + 1), cn(jmn + 1), dn(jmn + 1)56 real:: aa, bb, cc, dd57 real:: pi53 INTEGER :: i, j, ii, jj, k 54 REAL :: a(imo + 1), b(imo + 1), c(jmo + 1), d(jmo + 1) 55 REAL :: an(imn + 1), bn(imn + 1), cn(jmn + 1), dn(jmn + 1) 56 REAL :: aa, bb, cc, dd 57 REAL :: pi 58 58 59 59 pi = 2. * ASIN(1.) … … 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 … … 124 124 .or. ((an(ii)<b(i) + 2 * pi).and.(bn(ii)>a(i) + 2 * pi) & 125 125 .and.(a(i) + 2 * pi>pi)) & 126 ) then126 )THEN 127 127 ktotal = ktotal + 1 128 128 iik(ktotal) = ii … … 135 135 if (cc< c(j))cc = c(j) 136 136 if((an(ii)<b(i) - 2 * pi).and. & 137 (bn(ii)>a(i) - 2 * pi)) then137 (bn(ii)>a(i) - 2 * pi)) THEN 138 138 bb = min(b(i) - 2 * pi, bn(ii)) 139 139 aa = an(ii) 140 140 if (aa<a(i) - 2 * pi) aa = a(i) - 2 * pi 141 141 else if((an(ii)<b(i) + 2 * pi).and. & 142 (bn(ii)>a(i) + 2 * pi)) then142 (bn(ii)>a(i) + 2 * pi)) THEN 143 143 bb = min(b(i) + 2 * pi, bn(ii)) 144 144 aa = an(ii) … … 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)) then169 ! write(*,*) '**************** jj=',jj,'ii=',ii170 ! write(*,*) 'i,j =',i,j171 ! write(*,*) 'an,bn,cn,dn', an(ii), bn(ii), cn(jj),dn(jj)172 ! write(*,*) 'a,b,c,d', a(i), b(i), c(j),d(j)173 ! write(*,*) 'intersec(k)',intersec(k)174 ! write(*,*) 'airen(ii,jj)=',airen(ii,jj)167 ! 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 ! WRITE(*,*) '**************** jj=',jj,'ii=',ii 170 ! WRITE(*,*) 'i,j =',i,j 171 ! WRITE(*,*) 'an,bn,cn,dn', an(ii), bn(ii), cn(jj),dn(jj) 172 ! WRITE(*,*) 'a,b,c,d', a(i), b(i), c(j),d(j) 173 ! WRITE(*,*) 'intersec(k)',intersec(k) 174 ! WRITE(*,*) 'airen(ii,jj)=',airen(ii,jj) 175 175 ! end if 176 176 ! END DO -
LMDZ6/branches/Amaury_dev/libf/dyn3d/integrd.F90
r5113 r5116 7 7 8 8 use control_mod, ONLY: planet_type 9 use comconst_mod, only: pi9 use comconst_mod, ONLY: pi 10 10 USE logic_mod, ONLY: leapf 11 use comvert_mod, only: ap, bp11 use comvert_mod, ONLY: ap, bp 12 12 USE temps_mod, ONLY: dt 13 13 … … 98 98 DO ij = 1, ip1jmp1 99 99 IF(ps(ij)<0.) THEN 100 write(lunout, *) "integrd: negative surface pressure ", ps(ij)101 write(lunout, *) " at node ij =", ij100 WRITE(lunout, *) "integrd: negative surface pressure ", ps(ij) 101 WRITE(lunout, *) " at node ij =", ij 102 102 ! since ij=j+(i-1)*jjp1 , we have 103 103 j = modulo(ij, jjp1) 104 104 i = 1 + (ij - j) / jjp1 105 write(lunout, *) " lon = ", rlonv(i) * 180. / pi, " deg", &105 WRITE(lunout, *) " lon = ", rlonv(i) * 180. / pi, " deg", & 106 106 " lat = ", rlatu(j) * 180. / pi, " deg" 107 107 CALL abort_gcm("integrd", "", 1) … … 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 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/interp_horiz.F90
r5106 r5116 22 22 ! """"""""" 23 23 24 integer:: imo, jmo ! dimensions ancienne grille (input)25 integer:: imn, jmn ! dimensions nouvelle grille (input)24 INTEGER :: imo, jmo ! dimensions ancienne grille (input) 25 INTEGER :: imn, jmn ! dimensions nouvelle grille (input) 26 26 27 real:: rlonuo(imo + 1) ! Latitude et28 real:: rlatvo(jmo) ! longitude des29 real:: rlonun(imn + 1) ! bord des30 real:: rlatvn(jmn) ! cases "scalaires" (input)27 REAL :: rlonuo(imo + 1) ! Latitude et 28 REAL :: rlatvo(jmo) ! longitude des 29 REAL :: rlonun(imn + 1) ! bord des 30 REAL :: rlatvn(jmn) ! cases "scalaires" (input) 31 31 32 integer:: lm ! dimension verticale (input)33 real:: varo (imo + 1, jmo + 1, lm) ! var dans l'ancienne grille (input)34 real:: varn (imn + 1, jmn + 1, lm) ! var dans la nouvelle grille (output)32 INTEGER :: lm ! dimension verticale (input) 33 REAL :: varo (imo + 1, jmo + 1, lm) ! var dans l'ancienne grille (input) 34 REAL :: varn (imn + 1, jmn + 1, lm) ! var dans la nouvelle grille (output) 35 35 36 36 ! Autres variables 37 37 ! """""""""""""""" 38 real:: airetest(imn + 1, jmn + 1)39 integer:: ii, jj, l38 REAL :: airetest(imn + 1, jmn + 1) 39 INTEGER :: ii, jj, l 40 40 41 real:: airen (imn + 1, jmn + 1) ! aire dans la nouvelle grille41 REAL :: airen (imn + 1, jmn + 1) ! aire dans la nouvelle grille 42 42 ! Info sur les ktotal intersection entre les cases new/old grille 43 integer:: kllm, k, ktotal43 INTEGER :: kllm, k, ktotal 44 44 parameter (kllm = 400 * 200 * 10) 45 integer:: iik(kllm), jjk(kllm), jk(kllm), ik(kllm)46 real:: intersec(kllm)47 real:: R48 real:: totn, tots45 INTEGER :: iik(kllm), jjk(kllm), jk(kllm), ik(kllm) 46 REAL :: intersec(kllm) 47 REAL :: R 48 REAL :: totn, tots 49 49 50 50 logical :: firstcall, firsttest, aire_ok … … 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' 133 !! ! write(*,*)'ii,jj,airen,airetest',133 !! ! WRITE(*,*)'ii,jj,airen,airetest', 134 134 !! ! & ii,jj,airen(ii,jj),airetest(ii,jj) 135 135 !! aire_ok = .FALSE. … … 137 137 !! END DO 138 138 !! END DO 139 !! ! if (aire_ok) write(*,*) 'INTERP. HORIZ. : AIRES OK'139 !! ! if (aire_ok) WRITE(*,*) 'INTERP. HORIZ. : AIRES OK' 140 140 !! 99 continue 141 141 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/leapfrog.F90
r5114 r5116 15 15 iecri, ip_ebil_dyn, ok_dynzon, ok_dyn_ins, & 16 16 periodav, ok_dyn_ave, output_grads_dyn 17 use exner_hyb_m, only: exner_hyb18 use exner_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 … … 85 85 REAL :: w(ip1jmp1, llm) ! vertical velocity 86 86 87 real:: zqmin, zqmax87 REAL :: zqmin, zqmax 88 88 89 89 ! variables dynamiques intermediaire pour le transport … … 124 124 INTEGER :: ik 125 125 126 real:: time_step, t_wrt, t_ops126 REAL :: time_step, t_wrt, t_ops 127 127 128 128 ! REAL rdayvrai,rdaym_ini … … 137 137 save first 138 138 data first/.TRUE./ 139 real:: dt_cum140 character(len= 10) :: infile141 integer:: zan, tau0, thoriid142 integer:: nid_ctesGCM139 REAL :: dt_cum 140 CHARACTER(LEN = 10) :: infile 141 INTEGER :: zan, tau0, thoriid 142 INTEGER :: nid_ctesGCM 143 143 save nid_ctesGCM 144 real:: degres145 real:: rlong(iip1), rlatg(jjp1)146 real:: zx_tmp_2d(iip1, jjp1)147 integer:: ndex2d(iip1 * jjp1)144 REAL :: degres 145 REAL :: rlong(iip1), rlatg(jjp1) 146 REAL :: zx_tmp_2d(iip1, jjp1) 147 INTEGER :: ndex2d(iip1 * jjp1) 148 148 logical :: ok_sync 149 149 parameter (ok_sync = .TRUE.) … … 151 151 152 152 data callinigrads/.TRUE./ 153 character(len= 10) :: string10153 CHARACTER(LEN = 10) :: string10 154 154 155 155 REAL :: flxw(ip1jmp1, llm) ! flux de masse verticale … … 170 170 !-jld 171 171 172 character(len= 80) :: dynhist_file, dynhistave_file173 character(len= *), parameter :: modname = "leapfrog"174 character(len= 80) :: abort_message172 CHARACTER(LEN = 80) :: dynhist_file, dynhistave_file 173 CHARACTER(LEN = *), parameter :: modname = "leapfrog" 174 CHARACTER(LEN = 80) :: abort_message 175 175 176 176 logical :: dissip_conservative … … 186 186 logical, parameter :: flag_verif = .FALSE. 187 187 188 integer:: itau_w ! pas de temps ecriture = itap + itau_phy189 190 if (nday>=0) then188 INTEGER :: itau_w ! pas de temps ecriture = itap + itau_phy 189 190 if (nday>=0) THEN 191 191 itaufin = nday * day_step 192 192 else … … 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 … … 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 240 endif … … 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 314 endif … … 341 341 p, masse, dq, teta, & 342 342 flxw, pk) 343 ! write(*,*) 'caladvtrac 346'343 !WRITE(*,*) 'caladvtrac 346' 344 344 345 345 IF (offline) THEN … … 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 … … 417 417 jD_cur = jD_cur + int(jH_cur) 418 418 jH_cur = jH_cur - int(jH_cur) 419 ! write(lunout,*)'itau, jD_cur = ', itau, jD_cur, jH_cur419 ! WRITE(lunout,*)'itau, jD_cur = ', itau, jD_cur, jH_cur 420 420 ! CALL ju2ymds(jD_cur+jH_cur, an, mois, jour, secondes) 421 ! write(lunout,*)'current date = ',an, mois, jour, secondes421 ! WRITE(lunout,*)'current date = ',an, mois, jour, secondes 422 422 423 423 ! rajout debug … … 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 … … 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 … … 590 590 591 591 ! ajout debug 592 ! IF( lafin ) then592 ! IF( lafin ) THEN 593 593 ! abort_message = 'Simulation finished' 594 594 ! CALL abort_gcm(modname,abort_message,0) … … 620 620 ENDIF 621 621 622 IF(itau == itaufinp1) then623 if (flag_verif) then624 write(79, *) 'ucov', ucov625 write(80, *) 'vcov', vcov626 write(81, *) 'teta', teta627 write(82, *) 'ps', ps628 write(83, *) 'q', q622 IF(itau == itaufinp1) THEN 623 if (flag_verif) THEN 624 WRITE(79, *) 'ucov', ucov 625 WRITE(80, *) 'vcov', vcov 626 WRITE(81, *) 'teta', teta 627 WRITE(82, *) 'ps', ps 628 WRITE(83, *) 'q', q 629 629 WRITE(85, *) 'q1 = ', q(:, :, 1) 630 630 WRITE(86, *) 'q3 = ', q(:, :, 3) … … 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) then678 ! write(lunout,*) "leapfrog: CALL writehist, itau=",itau677 if (ok_dyn_ins) THEN 678 ! WRITE(lunout,*) "leapfrog: CALL writehist, itau=",itau 679 679 CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis) 680 680 ! CALL WriteField('ucov',reshape(ucov,(/iip1,jmp1,llm/))) … … 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 … … 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, & … … 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 … … 760 760 761 761 forward = .FALSE. 762 IF(itau == itaufinp1) then762 IF(itau == itaufinp1) THEN 763 763 abort_message = 'Simulation finished' 764 764 CALL abort_gcm(modname, abort_message, 0) … … 799 799 vnat(:, l) = vcov(:, l) / cv(:) 800 800 enddo 801 if (ok_dyn_ins) then802 ! write(lunout,*) "leapfrog: CALL writehist (b)",801 if (ok_dyn_ins) THEN 802 ! WRITE(lunout,*) "leapfrog: CALL writehist (b)", 803 803 ! & itau,iecri 804 804 CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis) 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 817 ! endif ! of if (planet_type.eq."earth") 818 if (ok_guide) then818 if (ok_guide) THEN 819 819 ! ! set ok_guide to false to avoid extra output 820 820 ! ! in following forward step -
LMDZ6/branches/Amaury_dev/libf/dyn3d/qminimum.F90
r5113 r5116 33 33 REAL :: zx_defau, zx_abc, zx_pump(ip1jmp1), pompe 34 34 35 real:: zx_defau_diag(ip1jmp1, llm, 2)36 real:: q_follow(ip1jmp1, llm, 2)35 REAL :: zx_defau_diag(ip1jmp1, llm, 2) 36 REAL :: q_follow(ip1jmp1, llm, 2) 37 37 ! 38 38 REAL :: SSUM … … 64 64 DO k = 1, llm 65 65 DO i = 1, ip1jmp1 66 if (seuil_liq - q(i, k, iq_liq) > 0.d0) then 67 66 if (seuil_liq - q(i, k, iq_liq) > 0.d0) THEN 68 67 if (niso > 0) zx_defau_diag(i, k, 2) = AMAX1 & 69 68 (seuil_liq - q(i, k, iq_liq), 0.0) … … 81 80 !cc zx_abc = dpres(k) / dpres(k-1) 82 81 DO i = 1, ip1jmp1 83 if (seuil_vap - q(i, k, iq_vap) > 0.d0) then 84 82 if (seuil_vap - q(i, k, iq_vap) > 0.d0) THEN 85 83 if (niso > 0) zx_defau_diag(i, k, 1) & 86 84 = AMAX1(seuil_vap - q(i, k, iq_vap), 0.0) … … 113 111 ENDIF 114 112 115 ! write(*,*) 'qminimum 128'116 if (niso > 0) then113 !WRITE(*,*) 'qminimum 128' 114 if (niso > 0) THEN 117 115 ! CRisi: traiter de même les traceurs d'eau 118 116 ! Mais il faut les prendre à l'envers pour essayer de conserver la … … 123 121 ! génant 124 122 DO i = 1, ip1jmp1 125 if (zx_pump(i)>0.0) then123 if (zx_pump(i)>0.0) THEN 126 124 q_follow(i, 1, 1) = q_follow(i, 1, 1) + zx_pump(i) 127 endif !if (zx_pump(i).gt.0.0) then125 endif !if (zx_pump(i).gt.0.0) THEN 128 126 enddo !DO i = 1,ip1jmp1 129 127 130 128 ! 2) transfert de vap vers les couches plus hautes 131 ! write(*,*) 'qminimum 139'129 !WRITE(*,*) 'qminimum 139' 132 130 do k = 2, llm 133 131 DO i = 1, ip1jmp1 134 if (zx_defau_diag(i, k, 1)>0.0) then132 if (zx_defau_diag(i, k, 1)>0.0) THEN 135 133 ! on ajoute la vapeur en k 136 134 do ixt = 1, ntiso … … 153 151 - zx_defau_diag(i, k, 1) & 154 152 * deltap(i, k) / deltap(i, k - 1) 155 endif !if (zx_defau_diag(i,k,1).gt.0.0) then153 endif !if (zx_defau_diag(i,k,1).gt.0.0) THEN 156 154 enddo !DO i = 1, ip1jmp1 157 155 enddo !do k=2,llm … … 161 159 162 160 ! 3) transfert d'eau de la vapeur au liquide 163 ! write(*,*) 'qminimum 164'161 !WRITE(*,*) 'qminimum 164' 164 162 do k = 1, llm 165 163 DO i = 1, ip1jmp1 166 if (zx_defau_diag(i, k, 2)>0.0) then 167 164 if (zx_defau_diag(i, k, 2)>0.0) THEN 168 165 ! ! on ajoute eau liquide en k en k 169 166 do ixt = 1, ntiso … … 180 177 q_follow(i, k, 1) = q_follow(i, k, 1) & 181 178 - zx_defau_diag(i, k, 2) 182 endif !if (zx_defau_diag(i,k,1).gt.0.0) then179 endif !if (zx_defau_diag(i,k,1).gt.0.0) THEN 183 180 enddo !DO i = 1, ip1jmp1 184 181 enddo !do k=2,llm … … 186 183 CALL check_isotopes_seq(q, ip1jmp1, 'qminimum 197') 187 184 188 endif !if (niso > 0) then189 ! ! write(*,*) 'qminimum 188'185 endif !if (niso > 0) THEN 186 ! !WRITE(*,*) 'qminimum 188' 190 187 191 188 ! -
LMDZ6/branches/Amaury_dev/libf/dyn3d/replay3d.F90
r5103 r5116 71 71 LOGICAL lafin 72 72 73 integer:: ntime=10000,it,klon,klev73 INTEGER :: ntime=10000,it,klon,klev 74 74 75 75 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/sw_case_williamson91_6.F90
r5103 r5116 87 87 enddo 88 88 enddo 89 write(lunout, *) 'W91 ps', MAXVAL(ps), MINVAL(ps)89 WRITE(lunout, *) 'W91 ps', MAXVAL(ps), MINVAL(ps) 90 90 ! vitesse zonale ucov 91 91 do j = 1, jjp1 … … 101 101 enddo 102 102 enddo 103 write(lunout, *) 'W91 u', MAXVAL(ucov(:, 1)), MINVAL(ucov(:, 1))103 WRITE(lunout, *) 'W91 u', MAXVAL(ucov(:, 1)), MINVAL(ucov(:, 1)) 104 104 ucov(:, 1) = ucov(:, 1) * cu 105 105 ! vitesse meridienne vcov … … 114 114 enddo 115 115 enddo 116 write(lunout, *) 'W91 v', MAXVAL(vcov(:, 1)), MINVAL(vcov(:, 1))116 WRITE(lunout, *) 'W91 v', MAXVAL(vcov(:, 1)), MINVAL(vcov(:, 1)) 117 117 vcov(:, 1) = vcov(:, 1) * cv 118 118 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/tetaleveli1j.F90
r5105 r5116 33 33 REAL :: pgcm(ilon, ilev) 34 34 REAL :: Qgcm(ilon, ilev) 35 real:: pres35 REAL :: pres 36 36 REAL :: Qpres(ilon) 37 37 … … 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 !===================================================================== -
LMDZ6/branches/Amaury_dev/libf/dyn3d/tetaleveli1j1.F90
r5105 r5116 33 33 REAL :: pgcm(ilon, ilev) 34 34 REAL :: Qgcm(ilon, ilev) 35 real:: pres35 REAL :: pres 36 36 REAL :: Qpres(ilon) 37 37 … … 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 !===================================================================== -
LMDZ6/branches/Amaury_dev/libf/dyn3d/top_bound.F90
r5113 r5116 70 70 REAL :: uzon(jjp1, llm), vzon(jjm, llm), tzon(jjp1, llm) 71 71 72 integer:: i72 INTEGER :: i 73 73 REAL, SAVE :: rdamp(llm) ! quenching coefficient 74 74 real, save :: lambda(llm) ! inverse or quenching time scale (Hz) … … 80 80 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 … … 99 99 rdamp(:) = 1. - exp(-lambda(:) * dt) 100 100 101 write(lunout, *)'TOP_BOUND mode', mode_top_bound102 write(lunout, *)'Sponge layer coefficients'103 write(lunout, *)'p (Pa) z(km) tau(s) 1./tau (Hz)'101 WRITE(lunout, *)'TOP_BOUND mode', mode_top_bound 102 WRITE(lunout, *)'Sponge layer coefficients' 103 WRITE(lunout, *)'p (Pa) z(km) tau(s) 1./tau (Hz)' 104 104 do l = 1, llm 105 if (rdamp(l)/=0.) then106 write(lunout, '(6(1pe12.4,1x))') &105 if (rdamp(l)/=0.) THEN 106 WRITE(lunout, '(6(1pe12.4,1x))') & 107 107 presnivs(l), log(preff / presnivs(l)) * scaleheight, & 108 108 1. / lambda(l), lambda(l) … … 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 … … 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 … … 161 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 … … 183 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 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/vlsplt.F90
r5113 r5116 361 361 ! CRisi: appel récursif de l'advection sur les fils. 362 362 ! Il faut faire ça avant d'avoir mis à jour q et masse 363 ! write(*,*) 'vlsplt 326: iq,nqDesc(iq)=',iq,tracers(iq)%nqDescen363 !WRITE(*,*) 'vlsplt 326: iq,nqDesc(iq)=',iq,tracers(iq)%nqDescen 364 364 365 365 do ifils=1,tracers(iq)%nqDescen … … 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 … … 464 464 465 465 REAL :: convpn,convps,convmpn,convmps 466 real:: massepn,masseps,qpn,qps466 REAL :: massepn,masseps,qpn,qps 467 467 REAL :: sinlon(iip1),sinlondlon(iip1) 468 468 REAL :: coslon(iip1),coslondlon(iip1) … … 479 479 DATA first/.TRUE./ 480 480 481 ! ! write(*,*) 'vly 578: entree, iq=',iq481 ! !WRITE(*,*) 'vly 578: entree, iq=',iq 482 482 483 483 IF(first) THEN … … 658 658 ENDDO 659 659 660 ! ! write(*,*) 'vly 756'660 ! !WRITE(*,*) 'vly 756' 661 661 DO l=1,llm 662 662 DO ij=1,ip1jm … … 676 676 ! CRisi: appel récursif de l'advection sur les fils. 677 677 ! Il faut faire ça avant d'avoir mis à jour q et masse 678 ! write(*,*) 'vly 689: iq,nqDesc(iq)=',iq,tracers(iq)%nqDescen678 ! WRITE(*,*) 'vly 689: iq,nqDesc(iq)=',iq,tracers(iq)%nqDescen 679 679 680 680 do ifils=1,tracers(iq)%nqDescen … … 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 … … 744 744 enddo 745 745 746 ! ! write(*,*) 'vly 853: sortie'746 ! !WRITE(*,*) 'vly 853: sortie' 747 747 748 748 … … 814 814 ENDDO 815 815 816 ! ! write(*,*) 'vlz 954'816 ! !WRITE(*,*) 'vlz 954' 817 817 DO ij=1,ip1jmp1 818 818 dzq(ij,1)=0. … … 846 846 ! CRisi: appel récursif de l'advection sur les fils. 847 847 ! Il faut faire ça avant d'avoir mis à jour q et masse 848 ! ! write(*,*) 'vlsplt 942: iq,nqChildren(iq)=',iq,nqChildren(iq)848 ! !WRITE(*,*) 'vlsplt 942: iq,nqChildren(iq)=',iq,nqChildren(iq) 849 849 do ifils=1,tracers(iq)%nqDescen 850 850 iq2=tracers(iq)%iqDescen(ifils) … … 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 … … 897 897 INCLUDE "paramet.h" 898 898 899 character(len=20) :: comment900 real:: qmin,qmax901 real:: zq(ip1jmp1,llm)902 real:: zzq(iip1,jjp1,llm)899 CHARACTER(LEN=20) :: comment 900 REAL :: qmin,qmax 901 REAL :: zq(ip1jmp1,llm) 902 REAL :: zzq(iip1,jjp1,llm) 903 903 904 904 END SUBROUTINE minmaxq -
LMDZ6/branches/Amaury_dev/libf/dyn3d/vlspltqs.F90
r5113 r5116 171 171 ENDDO 172 172 enddo 173 ! write(*,*) 'vlspltqs 183: fin de la routine'173 !WRITE(*,*) 'vlspltqs 183: fin de la routine' 174 174 175 175 … … 452 452 ! CRisi: appel récursif de l'advection sur les fils. 453 453 ! Il faut faire ça avant d'avoir mis à jour q et masse 454 ! write(*,*) 'vlspltqs 326: iq,nqChildren(iq)=',iq,454 !WRITE(*,*) 'vlspltqs 326: iq,nqChildren(iq)=',iq, 455 455 ! & tracers(iq)%nqChildren 456 456 … … 758 758 ! CRisi: appel récursif de l'advection sur les fils. 759 759 ! Il faut faire ça avant d'avoir mis à jour q et masse 760 ! write(*,*) 'vlyqs 689: iq,nqChildren(iq)=',iq,760 !WRITE(*,*) 'vlyqs 689: iq,nqChildren(iq)=',iq, 761 761 ! & tracers(iq)%nqChildren 762 762 … … 772 772 do ifils = 1, tracers(iq)%nqChildren 773 773 iq2 = tracers(iq)%iqDescen(ifils) 774 ! ! write(*,*) 'vlyqs 783: appel rec de vly, iq2=',iq2774 ! !WRITE(*,*) 'vlyqs 783: appel rec de vly, iq2=',iq2 775 775 CALL vly(Ratio, pente_max, masseq, qbyv, iq2) 776 776 enddo … … 827 827 ENDDO 828 828 829 ! ! write(*,*) 'vly 866'829 ! !WRITE(*,*) 'vly 866' 830 830 831 831 ! retablir les fils en rapport de melange par rapport a l'air: … … 838 838 enddo 839 839 enddo 840 ! ! write(*,*) 'vly 879'840 ! !WRITE(*,*) 'vly 879' 841 841 842 842 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/wrgrads.f90
r5113 r5116 2 2 3 3 subroutine wrgrads(if, nl, field, name, titlevar) 4 USE lmdz_formcoord, ONLY: formcoord 4 5 IMPLICIT NONE 5 6 … … 14 15 15 16 ! arguments 16 integer:: if, nl17 real:: field(imx * jmx * lmx)17 INTEGER :: if, nl 18 REAL :: field(imx * jmx * lmx) 18 19 19 20 integer, parameter :: wp = selected_real_kind(p = 6, r = 36) 20 21 real(wp) field4(imx * jmx * lmx) 21 22 22 character(len= 10) :: name, file23 character(len= 10) :: titlevar23 CHARACTER(LEN = 10) :: name, file 24 CHARACTER(LEN = 10) :: titlevar 24 25 25 26 ! local 26 27 27 integer:: im, jm, lm, i, j, l, iv, iii, iji, iif, ijf28 INTEGER :: im, jm, lm, i, j, l, iv, iii, iji, iif, ijf 28 29 29 30 logical :: writectl … … 43 44 ! print*,im,jm,lm,name,firsttime(if) 44 45 45 if(firsttime(if)) then46 if(name==var(1, if)) then46 IF(firsttime(if)) THEN 47 IF(name==var(1, if)) THEN 47 48 firsttime(if) = .false. 48 49 ivar(if) = 1 … … 66 67 else 67 68 ivar(if) = mod(ivar(if), nvar(if)) + 1 68 if (ivar(if)==nvar(if)) then69 if (ivar(if)==nvar(if)) THEN 69 70 writectl = .true. 70 71 itime(if) = itime(if) + 1 71 72 endif 72 73 73 if(var(ivar(if), if)/=name) then74 IF(var(ivar(if), if)/=name) THEN 74 75 print*, 'Il faut stoker la meme succession de champs a chaque' 75 76 print*, 'pas de temps' … … 90 91 ! s (l-1)*imd(if)*jmd(if)+(iji-1)*imd(if)+iii 91 92 ! s ,(l-1)*imd(if)*jmd(if)+(ijf-1)*imd(if)+iif 92 write(unit(if) + 1, rec = irec(if)) &93 WRITE(unit(if) + 1, rec = irec(if)) & 93 94 ((field4((l - 1) * imd(if) * jmd(if) + (j - 1) * imd(if) + i) & 94 95 , i = iii, iif), j = iji, ijf) 95 96 enddo 96 if (writectl) then 97 97 if (writectl) THEN 98 98 file = fichier(if) 99 99 ! WARNING! on reecrase le fichier .ctl a chaque ecriture 100 100 open(unit(if), file = trim(file) // '.ctl' & 101 101 , form = 'formatted', status = 'unknown') 102 write(unit(if), '(a5,1x,a40)') &102 WRITE(unit(if), '(a5,1x,a40)') & 103 103 'DSET ', '^' // trim(file) // '.dat' 104 104 105 write(unit(if), '(a12)') 'UNDEF 1.0E30'106 write(unit(if), '(a5,1x,a40)') 'TITLE ', title(if)105 WRITE(unit(if), '(a12)') 'UNDEF 1.0E30' 106 WRITE(unit(if), '(a5,1x,a40)') 'TITLE ', title(if) 107 107 CALL formcoord(unit(if), im, xd(iii, if), 1., .false., 'XDEF') 108 108 CALL formcoord(unit(if), jm, yd(iji, if), 1., .true., 'YDEF') 109 109 CALL formcoord(unit(if), lm, zd(1, if), 1., .false., 'ZDEF') 110 write(unit(if), '(a4,i10,a30)') &110 WRITE(unit(if), '(a4,i10,a30)') & 111 111 'TDEF ', itime(if), ' LINEAR 02JAN1987 1MO ' 112 write(unit(if), '(a4,2x,i5)') 'VARS', nvar(if)112 WRITE(unit(if), '(a4,2x,i5)') 'VARS', nvar(if) 113 113 do iv = 1, nvar(if) 114 114 ! print*,'if,var(iv,if),nld(iv,if),nld(iv,if)-1/nld(iv,if)' 115 115 ! print*,if,var(iv,if),nld(iv,if),nld(iv,if)-1/nld(iv,if) 116 write(unit(if), 1000) var(iv, if), nld(iv, if) - 1 / nld(iv, if) &116 WRITE(unit(if), 1000) var(iv, if), nld(iv, if) - 1 / nld(iv, if) & 117 117 , 99, tvar(iv, if) 118 118 enddo 119 write(unit(if), '(a7)') 'ENDVARS'119 WRITE(unit(if), '(a7)') 'ENDVARS' 120 120 ! 121 121 1000 format(a5, 3x, i4, i3, 1x, a39) … … 125 125 endif ! writectl 126 126 127 128 129 127 END SUBROUTINE wrgrads 130 128 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/write_paramLMDZ_dyn.h
r5101 r5116 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.