Changeset 1650 for trunk/LMDZ.COMMON/libf
- Timestamp:
- Jan 25, 2017, 4:02:54 PM (8 years ago)
- Location:
- trunk/LMDZ.COMMON/libf
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/LMDZ.COMMON/libf/dyn3d/conf_gcm.F90 ¶
r1593 r1650 25 25 USE logic_mod, ONLY: tidal,purmats,ok_guide,read_start,iflag_phys, & 26 26 iflag_trac,ok_strato,ok_gradsfile,ok_limit,ok_etat0, & 27 moyzon_mu,moyzon_ch,ok_strato,fxyhypb,ysinus 27 moyzon_mu,moyzon_ch,ok_strato,fxyhypb,ysinus,read_orop 28 28 USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy, & 29 29 alphax,alphay,taux,tauy … … 53 53 ! ------ 54 54 55 CHARACTER ch1*72,ch2*72,ch3*72,ch4*1256 55 REAL clonn,clatt,grossismxx,grossismyy 57 56 REAL dzoomxx,dzoomyy, tauxx,tauyy 58 57 LOGICAL fxyhypbb, ysinuss 59 INTEGER i60 58 LOGICAL use_filtre_fft 61 59 ! … … 549 547 IF (use_filtre_fft) THEN 550 548 write(lunout,*)'STOP !!!' 551 write(lunout,*)'use_filtre_fft n est pas implemente dansdyn3d'549 write(lunout,*)'use_filtre_fft not implemented in dyn3d' 552 550 STOP 1 553 551 ENDIF … … 597 595 ok_etat0 = .TRUE. 598 596 CALL getin('ok_etat0',ok_etat0) 597 598 !Config Key = read_orop 599 !Config Desc = lecture du fichier de params orographiques sous maille 600 !Config Def = f 601 !Config Help = lecture fichier plutot que grid_noro 602 603 read_orop = .FALSE. 604 CALL getin('read_orop',read_orop) 599 605 600 606 !---------------------------------------- … … 954 960 write(lunout,*)' ok_limit = ', ok_limit 955 961 write(lunout,*)' ok_etat0 = ', ok_etat0 962 write(lunout,*)' read_orop = ', read_orop 956 963 if (planet_type=="titan") then 957 964 write(lunout,*)' moyzon_mu = ', moyzon_mu -
TabularUnified trunk/LMDZ.COMMON/libf/dyn3d/guide_mod.F90 ¶
r1508 r1650 13 13 use netcdf, only: nf90_nowrite, nf90_open, nf90_inq_varid, nf90_close 14 14 use pres2lev_mod 15 USE serre_mod, ONLY: grossismx16 15 17 16 IMPLICIT NONE … … 39 38 40 39 REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE :: alpha_u,alpha_v 41 REAL, ALLOCATABLE, DIMENSION(: ), PRIVATE, SAVE :: alpha_T,alpha_Q40 REAL, ALLOCATABLE, DIMENSION(:, :), PRIVATE, SAVE :: alpha_T,alpha_Q 42 41 REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE :: alpha_P,alpha_pcor 43 42 … … 64 63 SUBROUTINE guide_init 65 64 66 USE control_mod 65 USE control_mod, ONLY: day_step 66 USE serre_mod, ONLY: grossismx 67 67 68 68 IMPLICIT NONE … … 108 108 CALL getpar('gamma4',.false.,gamma4,'Zone sans rappel elargie') 109 109 CALL getpar('guide_BL',.true.,guide_BL,'guidage dans C.Lim') 110 110 111 111 ! Sauvegarde du for�age 112 112 CALL getpar('guide_sav',.false.,guide_sav,'sauvegarde guidage') … … 147 147 148 148 call fin_getparam 149 149 150 150 ! --------------------------------------------- 151 151 ! Determination du nombre de niveaux verticaux … … 222 222 ALLOCATE(alpha_v(ip1jm), stat = error) 223 223 IF (error /= 0) CALL abort_gcm(modname,abort_message,1) 224 ALLOCATE(alpha_T(i p1jmp1), stat = error)224 ALLOCATE(alpha_T(iip1, jjp1), stat = error) 225 225 IF (error /= 0) CALL abort_gcm(modname,abort_message,1) 226 ALLOCATE(alpha_Q(i p1jmp1), stat = error)226 ALLOCATE(alpha_Q(iip1, jjp1), stat = error) 227 227 IF (error /= 0) CALL abort_gcm(modname,abort_message,1) 228 228 ALLOCATE(alpha_P(ip1jmp1), stat = error) … … 312 312 SUBROUTINE guide_main(itau,ucov,vcov,teta,q,masse,ps) 313 313 314 USE control_mod 315 USE com vert_mod, ONLY: ap,bp,preff,presnivs316 USE com const_mod, ONLY: daysec,dtvr314 USE control_mod, ONLY: day_step, iperiod 315 USE comconst_mod, ONLY: dtvr, daysec 316 USE comvert_mod, ONLY: ap, bp, preff, presnivs 317 317 318 318 IMPLICIT NONE … … 541 541 542 542 USE comconst_mod, ONLY: pi 543 543 544 544 IMPLICIT NONE 545 545 … … 606 606 use exner_hyb_m, only: exner_hyb 607 607 use exner_milieu_m, only: exner_milieu 608 USE comvert_mod, ONLY: ap,bp,preff,pressure_exner 609 USE comconst_mod, ONLY: cpp,kappa 610 608 use comconst_mod, only: kappa, cpp 609 use comvert_mod, only: preff, pressure_exner, bp, ap 611 610 IMPLICIT NONE 612 611 … … 777 776 do j=1,jjp1 778 777 IF (guide_teta) THEN 779 780 781 782 783 778 do i=1,iim 779 ij=(j-1)*iip1+i 780 tgui1(ij,l)=zu1(i,j,l) 781 tgui2(ij,l)=zu2(i,j,l) 782 enddo 784 783 ELSE 785 786 787 788 789 784 do i=1,iim 785 ij=(j-1)*iip1+i 786 tgui1(ij,l)=zu1(i,j,l)*cpp/pk(i,j,l) 787 tgui2(ij,l)=zu2(i,j,l)*cpp/pk(i,j,l) 788 enddo 790 789 ENDIF 791 790 tgui1(j*iip1,l)=tgui1((j-1)*iip1+1,l) … … 855 854 ! Calcul des constantes de rappel alpha (=1/tau) 856 855 857 USE comconst_mod, ONLY: pi858 USE serre_mod, ONLY: clon,clat,grossismy859 856 use comconst_mod, only: pi 857 use serre_mod, only: clon, clat, grossismx, grossismy 858 860 859 implicit none 861 860 … … 1517 1516 SUBROUTINE guide_out(varname,hsize,vsize,field) 1518 1517 1518 USE comconst_mod, ONLY: pi 1519 1519 USE comvert_mod, ONLY: presnivs 1520 USE comconst_mod, ONLY: pi 1521 1520 use netcdf95, only: nf95_def_var, nf95_put_var 1521 use netcdf, only: nf90_float 1522 1522 1523 IMPLICIT NONE 1523 1524 … … 1537 1538 INTEGER :: nid, id_lonu, id_lonv, id_latu, id_latv, id_tim, id_lev 1538 1539 INTEGER :: vid_lonu,vid_lonv,vid_latu,vid_latv,vid_cu,vid_cv,vid_lev 1539 INTEGER :: vid_au,vid_av 1540 INTEGER :: vid_au,vid_av, varid_alpha_t, varid_alpha_q 1540 1541 INTEGER, DIMENSION (3) :: dim3 1541 1542 INTEGER, DIMENSION (4) :: dim4,count,start … … 1568 1569 ierr=NF_DEF_VAR(nid,"cv",NF_FLOAT,2,(/id_lonv,id_latv/),vid_cv) 1569 1570 ierr=NF_DEF_VAR(nid,"av",NF_FLOAT,2,(/id_lonv,id_latv/),vid_av) 1571 call nf95_def_var(nid, "alpha_T", nf90_float, (/id_lonv, id_latu/), & 1572 varid_alpha_t) 1573 call nf95_def_var(nid, "alpha_q", nf90_float, (/id_lonv, id_latu/), & 1574 varid_alpha_q) 1570 1575 1571 1576 ierr=NF_ENDDEF(nid) … … 1593 1598 ierr = NF_PUT_VAR_REAL(nid,vid_av,alpha_v) 1594 1599 #endif 1600 call nf95_put_var(nid, varid_alpha_t, alpha_t) 1601 call nf95_put_var(nid, varid_alpha_q, alpha_q) 1595 1602 ! -------------------------------------------------------------------- 1596 1603 ! Cr�ation des variables sauvegard�es -
TabularUnified trunk/LMDZ.COMMON/libf/dyn3d/logic_mod.F90 ¶
r1593 r1650 3 3 IMPLICIT NONE 4 4 5 LOGICAL purmats,forward,leapf,apphys,statcl,conser, & 6 & apdiss,apdelq,saison,ecripar,fxyhypb,ysinus & 7 & ,read_start,ok_guide,ok_strato,tidal,ok_gradsfile & 8 & ,ok_limit,ok_etat0 9 logical hybrid ! vertical coordinate is hybrid if true (sigma otherwise) 10 ! (only used if disvert_type==2) 11 logical moyzon_mu,moyzon_ch ! used for zonal averages in Titan 5 LOGICAL purmats ! true if time stepping is purely Matsuno scheme 6 ! false implies Matsuno-Leapfrog time stepping scheme 7 LOGICAL forward ! true if during forward phase of Matsuno step 8 LOGICAL leapf ! true if during a leapfrog time stepping step 9 LOGICAL apphys ! true if during a time step when physics will be called 10 LOGICAL statcl 11 LOGICAL conser 12 LOGICAL apdiss ! true if during a time step when dissipation will be called 13 LOGICAL apdelq 14 LOGICAL saison 15 LOGICAL ecripar 16 LOGICAL fxyhypb ! true if using hyperbolic function discretization 17 ! for latitudinal grid 18 LOGICAL ysinus ! true if using sine function discretiation 19 ! for latitudinal grid 20 LOGICAL read_start ! true if reading a start.nc file to initialize fields 21 LOGICAL ok_guide ! true if nudging 22 LOGICAL ok_strato 23 LOGICAL tidal ! true if adding tidal forces (for Titan) 24 LOGICAL ok_gradsfile 25 LOGICAL ok_limit ! true for boundary conditions file creation (limit.nc) 26 LOGICAL ok_etat0 ! true for initial states creation (start.nc, startphy.nc) 27 LOGICAL read_orop ! true for sub-cell scales orographic params read in file 28 LOGICAL hybrid ! vertical coordinate is hybrid if true (sigma otherwise) 29 ! (only used if disvert_type==2) 30 LOGICAL moyzon_mu,moyzon_ch ! used for zonal averages in Titan 12 31 13 integer iflag_phys,iflag_trac 32 INTEGER iflag_phys ! type of physics to call: 0 none, 1: phy*** package, 33 ! 2: Held & Suarez, 101-200: aquaplanets & terraplanets 34 INTEGER iflag_trac 14 35 15 36 END MODULE logic_mod -
TabularUnified trunk/LMDZ.COMMON/libf/dyn3d/temps_mod.F90 ¶
r1422 r1650 3 3 IMPLICIT NONE 4 4 5 ! jD_ref = jour julien de la date de reference (lancement de l'experience)6 ! hD_ref = "heure" julienne de la date de reference7 8 5 INTEGER itaufin ! total number of dynamical steps for the run 9 INTEGER itau_dyn, itau_phy 6 INTEGER itau_dyn 7 INTEGER itau_phy 10 8 INTEGER day_ini ! initial day # of simulation sequence 11 9 INTEGER day_end ! final day # ; i.e. day # when this simulation ends … … 13 11 INTEGER day_ref 14 12 REAL dt ! (dynamics) time step (changes if doing Matsuno or LF step) 15 REAL jD_ref, jH_ref, start_time 16 CHARACTER (len=10) :: calend 13 REAL jD_ref ! reference julian day date (beginning of experiment) 14 REAL jH_ref ! reference julian "hour" of reference julian date 15 REAL start_time 16 CHARACTER (len=10) :: calend ! calendar type 17 17 18 18 ! Additionnal Mars stuff: -
TabularUnified trunk/LMDZ.COMMON/libf/dyn3d_common/comconst_mod.F90 ¶
r1572 r1650 12 12 REAL r ! Reduced Gas constant r=R/mu 13 13 ! with R=8.31.. J.K-1.mol-1, mu: mol mass of atmosphere (kg/mol) 14 REAL cpp ! Cp15 REAL kappa ! kappa= R/Cp14 REAL cpp ! Specific heat Cp (J.kg-1.K-1) 15 REAL kappa ! kappa=r/Cp 16 16 REAL cotot 17 17 REAL unsim ! = 1./iim … … 23 23 REAL dissip_fac_mid,dissip_fac_up,dissip_deltaz,dissip_hdelta 24 24 REAL dissip_pupstart 25 INTEGER iflag_top_bound,mode_top_bound 25 ! top_bound sponge: 26 INTEGER iflag_top_bound ! sponge type 26 27 INTEGER ngroup ! parameter to group points (along longitude) near poles 27 REAL tau_top_bound 28 INTEGER mode_top_bound ! sponge mode 29 REAL tau_top_bound ! inverse of sponge characteristic time scale (Hz) 28 30 REAL daylen ! length of solar day, in 'standard' day length 31 REAL year_day ! Number of standard days in a year 29 32 REAL molmass ! (g/mol) molar mass of the atmosphere 30 33 -
TabularUnified trunk/LMDZ.COMMON/libf/dyn3d_common/comvert_mod.F90 ¶
r1422 r1650 3 3 IMPLICIT NONE 4 4 5 include "dimensions.h" 6 include "paramet.h"5 PRIVATE 6 INCLUDE "dimensions.h" 7 7 8 REAL ap(llm+1),bp(llm+1),presnivs(llm),dpres(llm),pa,preff, & 9 nivsigs(llm),nivsig(llm+1),scaleheight 10 ! Mars Ce qui suit vient de gcm 11 REAL sig(llm+1),ds(llm),aps(llm),bps(llm),pseudoalt(llm) 8 PUBLIC :: ap,bp,presnivs,dpres,sig,ds,pa,preff,nivsigs,nivsig, & 9 aps,bps,scaleheight,pseudoalt,disvert_type, pressure_exner 10 11 REAL ap(llm+1) ! hybrid pressure contribution at interlayers 12 REAL bp (llm+1) ! hybrid sigma contribution at interlayer 13 REAL presnivs(llm) ! (reference) pressure at mid-layers 14 REAL dpres(llm) 15 REAL sig(llm+1) 16 REAL ds(llm) 17 REAL pa ! reference pressure (Pa) at which hybrid coordinates 18 ! become purely pressure (more or less) 19 REAL preff ! reference surface pressure (Pa) 20 REAL nivsigs(llm) 21 REAL nivsig(llm+1) 22 REAL aps(llm) ! hybrid pressure contribution at mid-layers 23 REAL bps(llm) ! hybrid sigma contribution at mid-layers 24 REAL scaleheight ! atmospheric (reference) scale height (km) 25 REAL pseudoalt(llm) ! pseudo-altitude of model levels (km), based on presnivs(), 26 ! preff and scaleheight 27 12 28 INTEGER disvert_type ! type of vertical discretization: 13 ! 1: Earth (default for planet_type==earth), 14 ! automatic generation 15 ! 2: Planets (default for planet_type!=earth), 16 ! using 'z2sig.def' (or 'esasig.def) file 29 ! 1: Earth (default for planet_type==earth), 30 ! automatic generation 31 ! 2: Planets (default for planet_type!=earth), 32 ! using 'z2sig.def' (or 'esasig.def) file 33 17 34 LOGICAL pressure_exner 18 35 ! compute pressure inside layers using Exner function, else use mean -
TabularUnified trunk/LMDZ.COMMON/libf/dyn3d_common/conf_planete.F90 ¶
r1422 r1650 10 10 USE ioipsl_getincom 11 11 #endif 12 USE comvert_mod, ONLY: preff,pa 13 USE comconst_mod, ONLY: daysec,daylen,kappa,cpp,omeg,rad,g,ihf,pi,molmass 12 USE comconst_mod, ONLY: pi, g, molmass, kappa, cpp, omeg, rad, & 13 year_day, daylen, daysec, ihf 14 USE comvert_mod, ONLY: preff, pa 14 15 IMPLICIT NONE 15 16 ! … … 17 18 ! Declarations : 18 19 ! -------------- 19 #include "dimensions.h" 20 20 21 ! 21 22 ! local: 22 23 ! ------ 23 24 real :: year_day_dyn25 24 26 25 ! --------------------------------------------- … … 59 58 CALL getin('daylen',daylen) 60 59 ! Number of days (standard) per year: 61 year_day _dyn= 365.2562 CALL getin('year_day',year_day _dyn)60 year_day = 365.25 61 CALL getin('year_day',year_day) 63 62 ! Omega 64 63 ! omeg=2.*pi/86400. 65 omeg=2.*pi/daysec*(1./daylen+1./year_day _dyn)64 omeg=2.*pi/daysec*(1./daylen+1./year_day) 66 65 CALL getin('omeg',omeg) 67 66 68 ! Intrinsic heat flux [default is none] 69 ! Aymeric -- for giant planets 70 ! [matters only if planet_type="giant"] 67 ! Intrinsic heat flux (default: none) (only used if planet_type="giant") 71 68 ihf = 0. 72 CALL getin('ihf',ihf) 73 74 69 call getin('ihf',ihf) 75 70 76 71 END SUBROUTINE conf_planete -
TabularUnified trunk/LMDZ.COMMON/libf/dyn3d_common/infotrac.F90 ¶
r1575 r1650 45 45 INTEGER :: niso_possibles 46 46 PARAMETER ( niso_possibles=5) ! 5 possible water isotopes 47 real, DIMENSION (niso_possibles),SAVE :: tnat,alpha_ideal47 REAL, DIMENSION (niso_possibles),SAVE :: tnat,alpha_ideal 48 48 LOGICAL, DIMENSION(niso_possibles),SAVE :: use_iso 49 49 INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE :: iqiso ! donne indice iq en fn de (ixt,phase) … … 55 55 INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE :: index_trac ! numéro ixt en fn izone, indnum entre 1 et niso 56 56 INTEGER,SAVE :: niso,ntraceurs_zone,ntraciso 57 58 #ifdef CPP_StratAer 59 !--CK/OB for stratospheric aerosols 60 INTEGER, SAVE :: nbtr_bin 61 INTEGER, SAVE :: nbtr_sulgas 62 INTEGER, SAVE :: id_OCS_strat 63 INTEGER, SAVE :: id_SO2_strat 64 INTEGER, SAVE :: id_H2SO4_strat 65 INTEGER, SAVE :: id_BIN01_strat 66 INTEGER, SAVE :: id_TEST_strat 67 #endif 57 68 58 69 CONTAINS … … 143 154 CALL abort_gcm('infotrac_init','You must compile with cpp key REPROBUS',1) 144 155 #endif 156 ELSE IF (type_trac == 'coag') THEN 157 WRITE(lunout,*) 'Tracers are treated for COAGULATION tests : type_trac=', type_trac 158 #ifndef CPP_StratAer 159 WRITE(lunout,*) 'To run this option you must add cpp key StratAer and compile with StratAer code' 160 CALL abort_gcm('infotrac_init','You must compile with cpp key StratAer',1) 161 #endif 145 162 ELSE IF (type_trac == 'lmdz') THEN 146 163 WRITE(lunout,*) 'Tracers are treated in LMDZ only : type_trac=', type_trac … … 166 183 !----------------------------------------------------------------------- 167 184 IF (planet_type=='earth') THEN 168 IF (type_trac == 'lmdz' .OR. type_trac == 'repr' ) THEN185 IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag') THEN 169 186 OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr) 170 187 IF(ierr.EQ.0) THEN … … 272 289 !--------------------------------------------------------------------- 273 290 IF (planet_type=='earth') THEN 274 IF (type_trac == 'lmdz' .OR. type_trac == 'repr' ) THEN291 IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag') THEN 275 292 IF(ierr.EQ.0) THEN 276 293 ! Continue to read tracer.def … … 352 369 END DO 353 370 371 ! IF ( planet_type=='earth') THEN 354 372 !CR: nombre de traceurs de l eau 355 if(tnom_0(3) == 'H2Oi') then373 IF (tnom_0(3) == 'H2Oi') then 356 374 nqo=3 357 else375 ELSE 358 376 nqo=2 359 endif377 ENDIF 360 378 ! For Earth, water vapour & liquid tracers are not in the physics 361 379 nbtr=nqtrue-nqo 362 ENDIF ! (type_trac == 'lmdz' .OR. type_trac == 'repr') 380 ! ELSE 381 ! ! Other planets (for now); we have the same number of tracers 382 ! ! in the dynamics than in the physics 383 ! nbtr=nqtrue 384 ! ENDIF 385 386 #ifdef CPP_StratAer 387 IF (type_trac == 'coag') THEN 388 nbtr_bin=0 389 nbtr_sulgas=0 390 DO iq=1,nqtrue 391 IF (tnom_0(iq)(1:3)=='BIN') THEN !check if tracer name contains 'BIN' 392 nbtr_bin=nbtr_bin+1 393 ENDIF 394 IF (tnom_0(iq)(1:3)=='GAS') THEN !check if tracer name contains 'GAS' 395 nbtr_sulgas=nbtr_sulgas+1 396 ENDIF 397 ENDDO 398 print*,'nbtr_bin=',nbtr_bin 399 print*,'nbtr_sulgas=',nbtr_sulgas 400 DO iq=1,nqtrue 401 IF (tnom_0(iq)=='GASOCS') THEN 402 id_OCS_strat=iq-nqo 403 ENDIF 404 IF (tnom_0(iq)=='GASSO2') THEN 405 id_SO2_strat=iq-nqo 406 ENDIF 407 IF (tnom_0(iq)=='GASH2SO4') THEN 408 id_H2SO4_strat=iq-nqo 409 ENDIF 410 IF (tnom_0(iq)=='BIN01') THEN 411 id_BIN01_strat=iq-nqo 412 ENDIF 413 IF (tnom_0(iq)=='GASTEST') THEN 414 id_TEST_strat=iq-nqo 415 ENDIF 416 ENDDO 417 print*,'id_OCS_strat =',id_OCS_strat 418 print*,'id_SO2_strat =',id_SO2_strat 419 print*,'id_H2SO4_strat=',id_H2SO4_strat 420 print*,'id_BIN01_strat=',id_BIN01_strat 421 ENDIF 422 #endif 423 424 ENDIF ! (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac = 'coag') 363 425 !jyg< 364 426 ! -
TabularUnified trunk/LMDZ.COMMON/libf/dyn3dpar/conf_gcm.F90 ¶
r1572 r1650 24 24 USE logic_mod, ONLY: tidal,purmats,ok_guide,read_start,iflag_phys,iflag_trac, & 25 25 ok_strato,ok_gradsfile,ok_limit,ok_etat0,moyzon_mu,moyzon_ch, & 26 fxyhypb,ysinus 26 fxyhypb,ysinus,read_orop 27 27 USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy, & 28 28 alphax,alphay,taux,tauy … … 53 53 ! ------ 54 54 55 CHARACTER ch1*72,ch2*72,ch3*72,ch4*1256 55 REAL clonn,clatt,grossismxx,grossismyy 57 56 REAL dzoomxx,dzoomyy, tauxx,tauyy 58 57 LOGICAL fxyhypbb, ysinuss 59 INTEGER i60 58 character(len=*),parameter :: modname="conf_gcm" 61 59 character (len=80) :: abort_message … … 638 636 ok_etat0 = .TRUE. 639 637 CALL getin('ok_etat0',ok_etat0) 638 639 !Config Key = read_orop 640 !Config Desc = lecture du fichier de params orographiques sous maille 641 !Config Def = f 642 !Config Help = lecture fichier plutot que grid_noro 643 644 read_orop = .FALSE. 645 CALL getin('read_orop',read_orop) 640 646 641 647 !---------------------------------------- … … 995 1001 write(lunout,*)' ok_limit = ', ok_limit 996 1002 write(lunout,*)' ok_etat0 = ', ok_etat0 1003 write(lunout,*)' read_orop = ', read_orop 997 1004 if (planet_type=="titan") then 998 1005 write(lunout,*)' moyzon_mu = ', moyzon_mu -
TabularUnified trunk/LMDZ.COMMON/libf/dyn3dpar/guide_p_mod.F90 ¶
r1422 r1650 38 38 39 39 REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE :: alpha_u,alpha_v 40 REAL, ALLOCATABLE, DIMENSION(: ), PRIVATE, SAVE :: alpha_T,alpha_Q40 REAL, ALLOCATABLE, DIMENSION(:, :), PRIVATE, SAVE :: alpha_T,alpha_Q 41 41 REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE :: alpha_P,alpha_pcor 42 42 … … 68 68 SUBROUTINE guide_init 69 69 70 USE control_mod 70 USE control_mod, ONLY: day_step 71 71 USE serre_mod, ONLY: grossismx 72 72 … … 237 237 ALLOCATE(alpha_v(ip1jm), stat = error) 238 238 IF (error /= 0) CALL abort_gcm(modname,abort_message,1) 239 ALLOCATE(alpha_T(i p1jmp1), stat = error)239 ALLOCATE(alpha_T(iip1, jjp1), stat = error) 240 240 IF (error /= 0) CALL abort_gcm(modname,abort_message,1) 241 ALLOCATE(alpha_Q(i p1jmp1), stat = error)241 ALLOCATE(alpha_Q(iip1, jjp1), stat = error) 242 242 IF (error /= 0) CALL abort_gcm(modname,abort_message,1) 243 243 ALLOCATE(alpha_P(ip1jmp1), stat = error) … … 339 339 USE parallel_lmdz 340 340 USE control_mod 341 USE com vert_mod, ONLY: ap,bp,preff,presnivs,pressure_exner342 USE com const_mod, ONLY: daysec,dtvr,kappa,cpp341 USE comconst_mod, ONLY: daysec, dtvr, cpp, kappa 342 USE comvert_mod, ONLY: ap, bp, preff, presnivs, pressure_exner 343 343 344 344 IMPLICIT NONE … … 618 618 619 619 USE comconst_mod, ONLY: pi 620 620 621 621 IMPLICIT NONE 622 622 … … 706 706 USE mod_hallo 707 707 USE Bands 708 USE com vert_mod, ONLY: ap,bp,preff,pressure_exner709 USE com const_mod, ONLY: kappa,cpp708 USE comconst_mod, ONLY: cpp, kappa 709 USE comvert_mod, ONLY: preff, pressure_exner, bp, ap 710 710 IMPLICIT NONE 711 711 … … 1098 1098 ! Calcul des constantes de rappel alpha (=1/tau) 1099 1099 1100 USE comconst_mod, ONLY: pi1101 USE serre_mod, ONLY: clon,clat,grossismx,grossismy1102 1100 use comconst_mod, only: pi 1101 use serre_mod, only: clat, clon, grossismx, grossismy 1102 1103 1103 implicit none 1104 1104 … … 1813 1813 SUBROUTINE guide_out(varname,hsize,vsize,field,factt) 1814 1814 USE parallel_lmdz 1815 USE comconst_mod, ONLY: pi 1815 1816 USE comvert_mod, ONLY: presnivs 1816 USE comconst_mod, ONLY: pi 1817 use netcdf95, only: nf95_def_var, nf95_put_var 1818 use netcdf, only: nf90_float 1819 1817 1820 IMPLICIT NONE 1818 1821 … … 1833 1836 INTEGER :: nid, id_lonu, id_lonv, id_latu, id_latv, id_tim, id_lev 1834 1837 INTEGER :: vid_lonu,vid_lonv,vid_latu,vid_latv,vid_cu,vid_cv,vid_lev 1835 INTEGER :: vid_au,vid_av 1838 INTEGER :: vid_au,vid_av, varid_alpha_t, varid_alpha_q 1836 1839 INTEGER :: l 1837 1840 INTEGER, DIMENSION (3) :: dim3 … … 1871 1874 ierr=NF_DEF_VAR(nid,"au",NF_FLOAT,2,(/id_lonu,id_latu/),vid_au) 1872 1875 ierr=NF_DEF_VAR(nid,"av",NF_FLOAT,2,(/id_lonv,id_latv/),vid_av) 1876 call nf95_def_var(nid, "alpha_T", nf90_float, (/id_lonv, id_latu/), & 1877 varid_alpha_t) 1878 call nf95_def_var(nid, "alpha_q", nf90_float, (/id_lonv, id_latu/), & 1879 varid_alpha_q) 1873 1880 1874 1881 ierr=NF_ENDDEF(nid) … … 1898 1905 ierr = NF_PUT_VAR_REAL(nid,vid_av,alpha_v) 1899 1906 #endif 1907 call nf95_put_var(nid, varid_alpha_t, alpha_t) 1908 call nf95_put_var(nid, varid_alpha_q, alpha_q) 1900 1909 ! -------------------------------------------------------------------- 1901 1910 ! Cr�ation des variables sauvegard�es -
TabularUnified trunk/LMDZ.COMMON/libf/dyn3dpar/logic_mod.F90 ¶
r1593 r1650 1 ! 2 ! $Id: $ 3 ! 1 4 MODULE logic_mod 2 5 3 6 IMPLICIT NONE 4 7 5 LOGICAL purmats,forward,leapf,apphys,statcl,conser, & 6 & apdiss,apdelq,saison,ecripar,fxyhypb,ysinus & 7 & ,read_start,ok_guide,ok_strato,tidal,ok_gradsfile & 8 & ,ok_limit,ok_etat0 9 logical hybrid ! vertical coordinate is hybrid if true (sigma otherwise) 10 ! (only used if disvert_type==2) 11 logical moyzon_mu,moyzon_ch ! used for zonal averages in Titan 8 LOGICAL purmats ! true if time stepping is purely Matsuno scheme 9 ! false implies Matsuno-Leapfrog time stepping scheme 10 LOGICAL forward ! true if during forward phase of Matsuno step 11 LOGICAL leapf ! true if during a leapfrog time stepping step 12 LOGICAL apphys ! true if during a time step when physics will be called 13 LOGICAL statcl 14 LOGICAL conser 15 LOGICAL apdiss ! true if during a time step when dissipation will be called 16 LOGICAL apdelq 17 LOGICAL saison 18 LOGICAL ecripar 19 LOGICAL fxyhypb ! true if using hyperbolic function discretization 20 ! for latitudinal grid 21 LOGICAL ysinus ! true if using sine function discretiation 22 ! for latitudinal grid 23 LOGICAL read_start ! true if reading a start.nc file to initialize fields 24 LOGICAL ok_guide ! true if nudging 25 LOGICAL ok_strato 26 LOGICAL tidal ! true if adding tidal forces (for Titan) 27 LOGICAL ok_gradsfile 28 LOGICAL ok_limit ! true for boundary conditions file creation (limit.nc) 29 LOGICAL ok_etat0 ! true for initial states creation (start.nc, startphy.nc) 30 LOGICAL read_orop ! true for sub-cell scales orographic params read in file 31 LOGICAL hybrid ! vertical coordinate is hybrid if true (sigma otherwise) 32 ! (only used if disvert_type==2) 33 LOGICAL moyzon_mu,moyzon_ch ! used for zonal averages in Titan 12 34 13 integer iflag_phys,iflag_trac 35 INTEGER iflag_phys ! type of physics to call: 0 none, 1: phy*** package, 36 ! 2: Held & Suarez, 101-200: aquaplanets & terraplanets 37 INTEGER iflag_trac 14 38 15 39 !$OMP THREADPRIVATE(purmats,forward,leapf,apphys,statcl,conser, & 16 17 18 !$OMP ok_limit,ok_etat0)40 !$OMP apdiss,apdelq,saison,ecripar,fxyhypb,ysinus, & 41 !$OMP read_start,ok_guide,ok_strato,tidal,ok_gradsfile, & 42 !$OMP ok_limit,ok_etat0,hybrid,moyzon_mu,moyzon_ch) 19 43 !$OMP THREADPRIVATE(iflag_phys,iflag_trac) 20 44 21 !BE CAREFUL: when adding a threadprivate variable in this module 22 ! do not forget to add it to copyin clause of gcm.F (before CALL leapfrog_p) 45 !WARNING: when adding a threadprivate variable in this module 46 ! do not forget to add it to the copyin clause when opening an OpenMP 47 ! parallel section. e.g. in gcm before call leapfrog_loc 23 48 24 49 END MODULE logic_mod -
TabularUnified trunk/LMDZ.COMMON/libf/dyn3dpar/temps_mod.F90 ¶
r1422 r1650 3 3 IMPLICIT NONE 4 4 5 ! jD_ref = jour julien de la date de reference (lancement de l'experience) 6 ! hD_ref = "heure" julienne de la date de reference 5 INTEGER itaufin ! total number of dynamical steps for the run 6 INTEGER itau_dyn 7 INTEGER itau_phy 8 INTEGER day_ini ! initial day # of simulation sequence 9 INTEGER day_end ! final day # ; i.e. day # when this simulation ends 10 INTEGER annee_ref 11 INTEGER day_ref 12 REAL dt ! (dynamics) time step (changes if doing Matsuno or LF step) 13 REAL jD_ref ! reference julian day date (beginning of experiment) 14 REAL jH_ref ! reference julian "hour" of reference julian date 15 REAL start_time 16 CHARACTER (len=10) :: calend ! calendar type 7 17 8 INTEGER itaufin ! total number of dynamical steps for the run 9 INTEGER itau_dyn, itau_phy 10 INTEGER day_ini ! initial day # of simulation sequence 11 INTEGER day_end ! final day # ; i.e. day # when this simulation ends 12 INTEGER annee_ref 13 INTEGER day_ref 14 REAL dt ! (dynamics) time step (changes if doing Matsuno or LF step) 15 REAL jD_ref, jH_ref, start_time 16 CHARACTER (len=10) :: calend 18 ! Additionnal Mars stuff: 19 REAL hour_ini ! initial fraction of day of simulation sequence (0=<hour_ini<1) 17 20 18 ! Additionnal Mars stuff: 19 real hour_ini ! initial fraction of day of simulation sequence (0=<hour_ini<1) 21 !$OMP THREADPRIVATE(dt,jD_ref,jH_ref,start_time,hour_ini, & 22 !$OMP day_ini,day_end,annee_ref,day_ref,itau_dyn,itau_phy,itaufin,& 23 !$OMP calend) 20 24 21 !$OMP THREADPRIVATE(dt,jD_ref,jH_ref,start_time,hour_ini, & 22 !$OMP day_ini,day_end,annee_ref,day_ref,itau_dyn,itau_phy,itaufin, & 23 !$OMP calend) 24 25 !BE CAREFUL: when adding a threadprivate variable in this module 26 ! do not forget to add it to copyin clause of gcm.F (before CALL leapfrog_p) 25 !WARNING: when adding a threadprivate variable in this module 26 ! do not forget to add it to the copyin clause when opening an OpenMP 27 ! parallel section. e.g. in gcm before call leapfrog_loc and/or 28 ! possibly in iniphysiq 27 29 28 30 END MODULE temps_mod -
TabularUnified trunk/LMDZ.COMMON/libf/misc/wxios.F90 ¶
r1575 r1650 25 25 !$OMP THREADPRIVATE(missing_val) 26 26 27 #ifdef XIOS1 28 #error "XIOS v1 no longer supported, use XIOS v2." 29 #endif 30 27 31 CONTAINS 28 32 … … 33 37 SUBROUTINE reformadate(odate, ndate) 34 38 CHARACTER(len=*), INTENT(IN) :: odate 35 #ifdef XIOS136 CHARACTER(len=100), INTENT(OUT) :: ndate37 #else38 39 TYPE(xios_duration) :: ndate 39 #endif40 40 41 41 INTEGER :: i = 0 … … 52 52 i = INDEX(odate, "day") 53 53 IF (i > 0) THEN 54 #ifdef XIOS155 ndate = odate(1:i-1)//"d"56 #else57 54 read(odate(1:i-1),*) ndate%day 58 #endif59 55 END IF 60 56 61 57 i = INDEX(odate, "hr") 62 58 IF (i > 0) THEN 63 #ifdef XIOS164 ndate = odate(1:i-1)//"h"65 #else66 59 read(odate(1:i-1),*) ndate%hour 67 #endif68 60 END IF 69 61 70 62 i = INDEX(odate, "mth") 71 63 IF (i > 0) THEN 72 #ifdef XIOS173 ndate = odate(1:i-1)//"mo"74 #else75 64 read(odate(1:i-1),*) ndate%month 76 #endif77 65 END IF 78 66 … … 197 185 198 186 !Variables pour xios: 199 #ifdef XIOS1200 TYPE(xios_time) :: mdtime201 #else202 187 TYPE(xios_duration) :: mdtime 203 #endif204 188 !REAL(kind = 8) :: year=0, month=0, day=0, hour=0, minute=0, second=0 205 189 206 #ifdef XIOS1207 mdtime = xios_time(0, 0, 0, 0, 0, pasdetemps)208 #else209 190 mdtime%second=pasdetemps 210 #endif211 191 212 192 !Réglage du calendrier: 213 #ifdef XIOS1214 SELECT CASE (calendrier)215 CASE('earth_360d')216 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "D360")217 IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier terrestre a 360 jours/an'218 CASE('earth_365d')219 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "NoLeap")220 IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier terrestre a 365 jours/an'221 CASE('gregorian')222 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "Gregorian")223 IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier gregorien'224 CASE DEFAULT225 abort_message = 'wxios_set_cal: Mauvais choix de calendrier'226 CALL abort_gcm('Gcm:Xios',abort_message,1)227 END SELECT228 #else229 193 SELECT CASE (calendrier) 230 194 CASE('earth_360d') … … 241 205 CALL abort_gcm('Gcm:Xios',abort_message,1) 242 206 END SELECT 243 #endif244 207 245 208 !Formatage de la date d'origine: … … 247 210 248 211 IF (prt_level >= 10) WRITE(lunout,*) "wxios_set_cal: Time origin: ", date 249 #ifdef XIOS1250 CALL xios_set_context_attr_hdl(g_ctx, time_origin = date)251 #else252 212 CALL xios_set_time_origin(xios_date(annee,mois,jour,int(heure),0,0)) 253 #endif254 213 255 214 !Formatage de la date de debut: … … 259 218 IF (prt_level >= 10) WRITE(lunout,*) "wxios_set_cal: Start date: ", date 260 219 261 #ifdef XIOS1262 CALL xios_set_context_attr_hdl(g_ctx, start_date = date)263 #else264 220 CALL xios_set_start_date(xios_date(ini_an,ini_mois,ini_jour,int(ini_heure),0,0)) 265 #endif266 221 267 222 !Et enfin,le pas de temps: … … 272 227 SUBROUTINE wxios_set_timestep(ts) 273 228 REAL, INTENT(IN) :: ts 274 #ifdef XIOS1275 TYPE(xios_time) :: mdtime276 277 mdtime = xios_time(0, 0, 0, 0, 0, ts)278 #else279 229 TYPE(xios_duration) :: mdtime 280 230 281 231 mdtime%timestep = ts 282 #endif283 232 284 233 CALL xios_set_timestep(mdtime) … … 334 283 335 284 !On parametrise le domaine: 336 #ifdef XIOS1337 CALL xios_set_domain_attr_hdl(dom, ni_glo=ni_glo, ibegin=ibegin, ni=ni)338 CALL xios_set_domain_attr_hdl(dom, nj_glo=nj_glo, jbegin=jbegin, nj=nj, data_dim=2)339 CALL xios_set_domain_attr_hdl(dom, lonvalue=io_lon(ibegin:iend), latvalue=io_lat(jbegin:jend))340 #else341 285 CALL xios_set_domain_attr_hdl(dom, ni_glo=ni_glo, ibegin=ibegin-1, ni=ni, type="rectilinear") 342 286 CALL xios_set_domain_attr_hdl(dom, nj_glo=nj_glo, jbegin=jbegin-1, nj=nj, data_dim=2) 343 287 CALL xios_set_domain_attr_hdl(dom, lonvalue_1d=io_lon(ibegin:iend), latvalue_1d=io_lat(jbegin:jend)) 344 #endif345 288 IF (.NOT.is_sequential) THEN 346 289 mask(:,:)=.TRUE. … … 353 296 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," mask(:,nj)=",mask(:,nj) 354 297 ENDIF 355 #ifdef XIOS1356 CALL xios_set_domain_attr_hdl(dom, mask=mask)357 #else358 298 CALL xios_set_domain_attr_hdl(dom, mask_2d=mask) 359 #endif360 299 END IF 361 300 … … 401 340 402 341 ! Ehouarn: New way to declare axis, without axis_group: 403 #ifdef XIOS1404 CALL xios_set_axis_attr(trim(axis_id),size=axis_size,value=axis_value)405 #else406 342 CALL xios_set_axis_attr(trim(axis_id),n_glo=axis_size,value=axis_value) 407 #endif 343 408 344 !Vérification: 409 345 IF (xios_is_valid_axis(TRIM(ADJUSTL(axis_id)))) THEN … … 429 365 TYPE(xios_file) :: x_file 430 366 TYPE(xios_filegroup) :: x_fg 431 #ifdef XIOS1432 CHARACTER(len=100) :: nffreq433 #else434 367 TYPE(xios_duration) :: nffreq 435 #endif436 368 437 369 !On regarde si le fichier n'est pas défini par XML: … … 445 377 446 378 !On configure: 447 #ifdef XIOS1448 CALL xios_set_file_attr_hdl(x_file, name="X"//fname,&449 output_freq=TRIM(ADJUSTL(nffreq)), output_level=flvl, enabled=.TRUE.)450 #else451 379 CALL xios_set_file_attr_hdl(x_file, name="X"//fname,& 452 380 output_freq=nffreq, output_level=flvl, enabled=.TRUE.) 453 #endif454 381 455 382 IF (xios_is_valid_file("X"//fname)) THEN 456 383 IF (prt_level >= 10) THEN 457 384 WRITE(lunout,*) "wxios_add_file: New file: ", "X"//fname 458 #ifdef XIOS1459 WRITE(lunout,*) "wxios_add_file: output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl460 #else461 385 WRITE(lunout,*) "wxios_add_file: output_freq=",nffreq,"; output_lvl=",flvl 462 #endif463 386 ENDIF 464 387 ELSE 465 388 WRITE(lunout,*) "wxios_add_file: Error, invalid file: ", "X"//trim(fname) 466 #ifdef XIOS1467 WRITE(lunout,*) "wxios_add_file: output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl468 #else469 389 WRITE(lunout,*) "wxios_add_file: output_freq=",nffreq,"; output_lvl=",flvl 470 #endif471 390 END IF 472 391 ELSE … … 538 457 TYPE(xios_field) :: field 539 458 TYPE(xios_fieldgroup) :: fieldgroup 540 #ifndef XIOS1541 459 TYPE(xios_duration) :: freq_op 542 #endif 460 543 461 LOGICAL :: bool=.FALSE. 544 462 INTEGER :: lvl =0 … … 599 517 600 518 !L'operation, sa frequence: 601 #ifdef XIOS1602 CALL xios_set_field_attr_hdl(field, field_ref=fieldname, operation=TRIM(ADJUSTL(operation)), freq_op="1ts", prec=4)603 #else604 519 freq_op%timestep=1 605 520 CALL xios_set_field_attr_hdl(field, field_ref=fieldname, operation=TRIM(ADJUSTL(operation)), freq_op=freq_op, prec=4) 606 #endif607 521 608 522
Note: See TracChangeset
for help on using the changeset viewer.