Changeset 1403 for trunk/LMDZ.COMMON
- Timestamp:
- Mar 31, 2015, 3:49:07 PM (10 years ago)
- Location:
- trunk/LMDZ.COMMON
- Files:
-
- 5 added
- 6 deleted
- 9 edited
- 6 copied
- 31 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/bld.cfg
r1302 r1403 26 26 src::dyn %SRC_PATH/%DYN 27 27 src::phys %SRC_PATH/%PHYS 28 src::dyn_phys %DYN_PHYS 29 src::dyn_phys_sub %DYN_PHYS_SUB 28 30 src::sisvat %SISVAT 29 31 src::rrtm %RRTM 30 32 src::grid %SRC_PATH/grid 31 src::filtrez % SRC_PATH/filtrez32 src::bibio %SRC_PATH/ bibio33 src::dyn3d_common % SRC_PATH/dyn3d_common33 src::filtrez %FILTRE 34 src::bibio %SRC_PATH/misc 35 src::dyn3d_common %DYN_COMMON 34 36 src::cosp %COSP 35 37 src::chem %CHEM -
trunk/LMDZ.COMMON/create_make_gcm
r1391 r1403 5 5 #set -xv 6 6 7 # arguments given to create_make_gcm are the directories to scan 8 src_dirs=$* 7 9 8 10 machine=`hostname` … … 48 50 fi 49 51 echo "LOCAL_DIR=`echo $localdir`" 50 echo ' BIBIO = $(LIBF)/bibio'51 echo 'DYN3D_COMMON = $(LIBF)/dyn3d_common'52 echo 'MISC = $(LIBF)/misc' 53 #echo 'DYN3D_COMMON = $(LIBF)/dyn3d_common' 52 54 echo "FILTRE = filtre" 53 55 echo "PHYS = " 54 56 echo 'LIBPHY = $(LIBO)/libphy$(PHYS).a' 57 echo 'LIBDYN_PHY = $(LIBO)/libdynlmdz_phy$(PHYS).a' 55 58 echo 'DIRMAIN=dyn$(DIM)d$(FLAG_PARA)' 56 59 echo 'RM=rm' … … 61 64 echo 'L_DYN = -ldyn$(DIM)d$(FLAG_PARA) -ldyn3d_common' 62 65 echo 'L_FILTRE = -l$(FILTRE)' 66 echo 'L_DYN_PHY = -ldynlmdz_phy$(PHYS) ' 63 67 echo 'L_PHY = -lphy$(PHYS) ' 64 echo 'L_ BIBIO = -lbibio'68 echo 'L_MISC = -lmisc' 65 69 echo 'L_ADJNT =' 66 70 echo 'L_COSP = -lcosp' … … 97 101 echo 98 102 #echo 'main : chimie $(DYN) bibio phys $(OPTION_DEP) ' 99 echo 'main : $(DYN) bibio phys$(OPTION_DEP) '103 echo 'main : $(DYN) misc phys dyn_phy $(OPTION_DEP) ' 100 104 echo ' cd $(LIBO) ; $(RANLIB) lib*.a ; cd $(GCM) ;\' 101 105 echo ' cd $(LOCAL_DIR); \' 102 106 echo ' $(COMPILE90) $(LIBF)/$(DIRMAIN)/$(SOURCE) -o $(PROG).o ; \' 103 echo ' $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ ADJNT) $(L_COSP) $(L_AERONOMARS) $(L_PHY) $(L_DYN) $(L_DYN3D_COMMON) $(L_BIBIO) $(L_DYN3D_COMMON) $(L_PHY) $(L_DYN) $(L_FILTRE) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o '107 echo ' $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_DYN_PHY) $(L_ADJNT) $(L_COSP) $(L_AERONOMARS) $(L_PHY) $(L_DYN) $(L_DYN3D_COMMON) $(L_MISC) $(L_DYN3D_COMMON) $(L_PHY) $(L_DYN_PHY) $(L_DYN) $(L_FILTRE) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o ' 104 108 echo 105 109 echo 'phys : $(LIBPHY)' … … 108 112 echo 'dyn1d :' 109 113 echo 114 echo 'dyn_phy: $(LIBDYN_PHYS)' 110 115 echo 111 116 #echo 'chimie : $(LIBO)/libchimie.a' 112 117 echo 113 echo ' bibio : $(LIBO)/libbibio.a'118 echo 'misc : $(LIBO)/libmisc.a' 114 119 echo 115 120 echo 'adjnt : $(LIBO)/libadjnt.a' … … 133 138 echo 134 139 cd $libf >/dev/null 2>&1 135 for diri in ` ls ` ; do 140 141 for diri in $src_dirs ; do 136 142 137 143 if [ -d $diri ] ; then 138 if [ "`ls $diri/*.F $diri/*/*.F`" != "" ] || [ "`ls $diri/*.[fF]90 $diri/*/*.[fF]90`" != "" ] ; then144 if [ "`ls $diri/*.F`" != "" ] || [ "`ls $diri/*.[fF]90`" != "" ] ; then 139 145 # cd $diri >/dev/null 2>&1 140 146 echo 141 147 listlib="" 142 148 # Liste des fichiers .F et .F90 n'etant pas des programmes principaux 143 for fili in `ls $diri/*.[fF] $diri/*/*.[fF]` ; do149 for fili in `ls $diri/*.[fF]` ; do 144 150 # Check if file is a routine or main program 145 151 # i.e: look for the "program" keword preceeded by leading spaces … … 150 156 fi 151 157 done 152 for fili in `ls $diri/*.[fF]90 $diri/*/*.[fF]90` ; do158 for fili in `ls $diri/*.[fF]90` ; do 153 159 # Check if file is a routine or main program 154 160 # i.e. look for "program" keyword (with possibly some leading spaces) … … 163 169 echo $listlib >> $logfile 164 170 echo 171 # topdiri contains main dir name (without trailing "/blabla" for subdirs) 172 topdiri=${diri%/*} 165 173 echo "#=======================================================================" 166 174 echo "# Contenu de la bibliotheque correspondant au Directory "$diri … … 170 178 do 171 179 fili=`echo $trufile | awk -F/ ' { print $NF } ' | cut -d. -f1` 172 echo '$(LIBO)/lib'$ diri".a : " '$(LIBO)/lib'$diri".a("$fili".o)"180 echo '$(LIBO)/lib'$topdiri".a : " '$(LIBO)/lib'$topdiri".a("$fili".o)" 173 181 echo 174 182 done 175 echo '.PRECIOUS : $(LIBO)/lib'$ diri'.a'176 echo 177 echo 178 echo "# Compilation des membres de la bibliotheque lib"$diri".a"183 echo '.PRECIOUS : $(LIBO)/lib'$topdiri'.a' 184 echo 185 echo 186 echo "# Compilation of elements in $diri of library lib"$topdiri".a" 179 187 echo 180 188 for trufile in $listlib ; do … … 183 191 egrep -i '^ *module ' $trufile > /dev/null 2>&1 && F90=1 184 192 egrep -i '#include*.inc ' $trufile > /dev/null 2>&1 && F90=1 185 str1='$(LIBO)/lib'$ diri'.a('$fili'.o) : $(LIBF)/'$trufile186 [ "$fili" = " chem.subs" ] && str1=$str1' $(LIBF)/'$diri/chem.mods.F193 str1='$(LIBO)/lib'$topdiri'.a('$fili'.o) : $(LIBF)/'$trufile 194 [ "$fili" = "$diri/chem.subs" ] && str1=$str1' $(LIBF)/'$diri/chem.mods.F 187 195 188 196 ########################################################################## … … 199 207 strj=`echo $stri | tr [A-Z] [a-z]` 200 208 str2="" 201 for dirinc in filtrez bibio dyn3d_common grid dyn3d phy* $diri $diri/*/; do209 for dirinc in $src_dirs ; do 202 210 # Recherche dans l'ordre hierarchique inverse car seule la derniere 203 211 # ligne est conservee 204 if [ $dirinc = phydev ] ; then205 dirstr='$(PHYS)'206 libstr='phy$(PHYS)'207 else212 # if [ $dirinc = phydev ] ; then 213 # dirstr='$(PHYS)' 214 # libstr='phy$(PHYS)' 215 # else 208 216 dirstr=$dirinc 209 217 libstr=$dirinc 210 fi218 # fi 211 219 echo dirinc $dirinc >> $logfile 212 220 if [ -f $dirinc/$stri ] ; then … … 238 246 # object from library 239 247 echo ' cd $(LIBO); \' 240 echo ' $(AR) d $(LIBO)/lib'$ diri'.a '$fili'.o ; \'248 echo ' $(AR) d $(LIBO)/lib'$topdiri'.a '$fili'.o ; \' 241 249 if [ "$F90" -eq '0' ] ; then 242 250 ## Fixed Form Fortran 77 … … 252 260 fi 253 261 # Put generated object in library 254 echo ' $(AR) r $(LIBO)/lib'$ diri'.a '$fili'.o ; $(RM) '$fili'.o ; \'262 echo ' $(AR) r $(LIBO)/lib'$topdiri'.a '$fili'.o ; $(RM) '$fili'.o ; \' 255 263 echo ' cd $(GCM)' 256 264 echo … … 303 311 str1='$(LIBF)/'$diri'/'$stri 304 312 else 305 for dirinc in dyn3d grid bibio313 for dirinc in dyn3d grid misc 306 314 do 307 315 if [ -f ../$dirinc/$stri ] ; then -
trunk/LMDZ.COMMON/libf/dyn3d/leapfrog.F
r1302 r1403 170 170 logical ok_sync 171 171 parameter (ok_sync = .true.) 172 logical physic 172 logical physics 173 173 174 174 data callinigrads/.true./ … … 251 251 252 252 itau = 0 253 physic =.true.254 if (iflag_phys==0.or.iflag_phys==2) physic =.false.253 physics=.true. 254 if (iflag_phys==0.or.iflag_phys==2) physics=.false. 255 255 256 256 c iday = day_ini+itau/day_step … … 362 362 s apdiss = .TRUE. 363 363 IF( MOD(itau,iphysiq ).EQ.0.AND..NOT.forward 364 s .and. physic ) apphys = .TRUE.364 s .and. physics ) apphys = .TRUE. 365 365 ELSE 366 366 ! Leapfrog/Matsuno time stepping … … 368 368 IF( MOD(itau+1,dissip_period).EQ.0 .AND. .NOT. forward ) 369 369 s apdiss = .TRUE. 370 IF( MOD(itau+1,iphysiq).EQ.0.AND.physic ) apphys=.TRUE.370 IF( MOD(itau+1,iphysiq).EQ.0.AND.physics ) apphys=.TRUE. 371 371 END IF 372 372 -
trunk/LMDZ.COMMON/libf/dyn3d/logic.h
r1302 r1403 12 12 & ,read_start,ok_guide,ok_strato,tidal,ok_gradsfile & 13 13 & ,ok_limit,ok_etat0,hybrid & 14 & ,moyzon_mu,moyzon_ch 14 & ,moyzon_mu,moyzon_ch,grireg,physic 15 15 16 16 COMMON/logici/ iflag_phys,iflag_trac … … 26 26 27 27 integer iflag_phys,iflag_trac 28 29 ! stuff for compatibility with Mars/Generic old dyn cores. To be cleaned! 30 logical grireg,physic 31 28 32 !----------------------------------------------------------------------- -
trunk/LMDZ.COMMON/libf/dyn3d_common/control_mod.F90
r1300 r1403 51 51 real,save :: timestart ! (Mars) time start for run in "start.nc" 52 52 53 ! stuff for compatibility with Mars/Generic old dyn cores. To be cleaned! 54 integer,save :: idissip ! (Mars/old dyn) dissipation freq. 55 real,save :: nday_r ! (Mars/old dyn) number of days to run (possibly including a fraction of day) 56 57 53 58 END MODULE -
trunk/LMDZ.COMMON/libf/dyn3d_common/infotrac.F90
r1391 r1403 444 444 END SUBROUTINE infotrac_init 445 445 446 ! Ehouarn: routine iniadvtrac => from Mars/generic; does essentially the 447 ! same job as infotrac_init. To clean up and merge at some point... 448 subroutine iniadvtrac(nq,numvanle) 449 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 450 ! routine which initializes tracer names and advection schemes 451 ! reads these infos from file 'traceur.def' but uses default values 452 ! if that file is not found. 453 ! Ehouarn Millour. Oct. 2008 (made this LMDZ4-like) for future compatibility 454 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 455 IMPLICIT NONE 456 457 !#include "dimensions.h" 458 !#include "advtrac.h" 459 !#include "control.h" 460 461 ! routine arguments: 462 INTEGER,INTENT(out) :: nq ! number of tracers 463 INTEGER,INTENT(out) :: numvanle 464 465 ! local variables: 466 LOGICAL :: first 467 INTEGER :: iq 468 INTEGER :: ierr 469 CHARACTER(len=3) :: qname 470 471 ! Look for file traceur.def 472 OPEN(90,file='traceur.def',form='formatted',status='old', & 473 iostat=ierr) 474 IF (ierr.eq.0) THEN 475 write(*,*) "iniadvtrac: Reading file traceur.def" 476 ! read number of tracers: 477 read(90,*,iostat=ierr) nq 478 if (ierr.ne.0) then 479 write(*,*) "iniadvtrac: error reading number of tracers" 480 write(*,*) " (first line of traceur.def) " 481 stop 482 endif 483 484 ! allocate arrays: 485 allocate(iadv(nq)) 486 allocate(tname(nq)) 487 488 ! initialize advection schemes to Van-Leer for all tracers 489 do iq=1,nq 490 iadv(iq)=3 ! Van-Leer 491 enddo 492 493 do iq=1,nq 494 ! minimal version, just read in the tracer names, 1 per line 495 read(90,*,iostat=ierr) tname(iq) 496 if (ierr.ne.0) then 497 write(*,*) 'iniadvtrac: error reading tracer names...' 498 stop 499 endif 500 enddo !of do iq=1,nq 501 close(90) ! done reading tracer names, close file 502 ENDIF ! of IF (ierr.eq.0) 503 504 ! .... Choix des shemas d'advection pour l'eau et les traceurs ... 505 ! ................................................................... 506 ! 507 ! iadv = 1 shema transport type "humidite specifique LMD" 508 ! iadv = 2 shema amont 509 ! iadv = 3 shema Van-leer 510 ! iadv = 4 schema Van-leer + humidite specifique 511 ! Modif F.Codron 512 ! 513 ! 514 DO iq = 1, nq-1 515 IF( iadv(iq).EQ.1 ) PRINT *,' Choix du shema humidite specifique'& 516 ,' pour le traceur no ', iq 517 IF( iadv(iq).EQ.2 ) PRINT *,' Choix du shema amont',' pour le' & 518 ,' traceur no ', iq 519 IF( iadv(iq).EQ.3 ) PRINT *,' Choix du shema Van-Leer ',' pour' & 520 ,'le traceur no ', iq 521 522 IF( iadv(iq).EQ.4 ) THEN 523 PRINT *,' Le shema Van-Leer + humidite specifique ', & 524 ' est uniquement pour la vapeur d eau .' 525 PRINT *,' Corriger iadv( ',iq, ') et repasser ! ' 526 CALL ABORT 527 ENDIF 528 529 IF( iadv(iq).LE.0.OR.iadv(iq).GT.4 ) THEN 530 PRINT *,' Erreur dans le choix de iadv (nqtot).Corriger et ' & 531 ,' repasser car iadv(iq) = ', iadv(iq) 532 CALL ABORT 533 ENDIF 534 ENDDO 535 536 IF( iadv(nq).EQ.1 ) PRINT *,' Choix du shema humidite ' & 537 ,'specifique pour la vapeur d''eau' 538 IF( iadv(nq).EQ.2 ) PRINT *,' Choix du shema amont',' pour la' & 539 ,' vapeur d''eau ' 540 IF( iadv(nq).EQ.3 ) PRINT *,' Choix du shema Van-Leer ' & 541 ,' pour la vapeur d''eau' 542 IF( iadv(nq).EQ.4 ) PRINT *,' Choix du shema Van-Leer + ' & 543 ,' humidite specifique pour la vapeur d''eau' 544 ! 545 IF( (iadv(nq).LE.0).OR.(iadv(nq).GT.4) ) THEN 546 PRINT *,' Erreur dans le choix de iadv (nqtot).Corriger et ' & 547 ,' repasser car iadv(nqtot) = ', iadv(nqtot) 548 CALL ABORT 549 ENDIF 550 551 first = .TRUE. 552 numvanle = nq + 1 553 DO iq = 1, nq 554 IF(((iadv(iq).EQ.3).OR.(iadv(iq).EQ.4)).AND.first ) THEN 555 numvanle = iq 556 first = .FALSE. 557 ENDIF 558 ENDDO 559 ! 560 DO iq = 1, nq 561 562 IF( (iadv(iq).NE.3.AND.iadv(iq).NE.4).AND.iq.GT.numvanle ) THEN 563 PRINT *,' Il y a discontinuite dans le choix du shema de ', & 564 'Van-leer pour les traceurs . Corriger et repasser . ' 565 CALL ABORT 566 ENDIF 567 568 ENDDO 569 ! 570 end subroutine iniadvtrac 571 572 446 573 END MODULE infotrac -
trunk/LMDZ.COMMON/libf/dyn3dpar/leapfrog_p.F
r1391 r1403 163 163 REAL :: secondes 164 164 real :: rdaym_ini 165 logical :: physic 165 logical :: physics 166 166 LOGICAL first,callinigrads 167 167 … … 256 256 257 257 itau = 0 258 physic =.true.259 if (iflag_phys==0.or.iflag_phys==2) physic =.false.258 physics=.true. 259 if (iflag_phys==0.or.iflag_phys==2) physics=.false. 260 260 ! iday = day_ini+itau/day_step 261 261 ! time = REAL(itau-(iday-day_ini)*day_step)/day_step+time_0 … … 433 433 s apdiss = .TRUE. 434 434 IF( MOD(itau,iphysiq ).EQ.0.AND..NOT.forward 435 s .and. physic ) apphys = .TRUE.435 s .and. physics ) apphys = .TRUE. 436 436 ELSE 437 437 ! Leapfrog/Matsuno time stepping … … 439 439 IF( MOD(itau+1,dissip_period).EQ.0 .AND. .NOT. forward ) 440 440 s apdiss = .TRUE. 441 IF( MOD(itau+1,iphysiq).EQ.0.AND.physic ) apphys=.TRUE.441 IF( MOD(itau+1,iphysiq).EQ.0.AND.physics) apphys=.TRUE. 442 442 END IF 443 443 -
trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/calfis.F
r1401 r1403 137 137 REAL,INTENT(OUT) :: pdpsfi(iip1,jjp1) ! tendency on surface pressure (Pa/s) 138 138 139 139 #ifndef CPP_PARA 140 140 c Local variables : 141 141 c ----------------- … … 955 955 firstcal = .FALSE. 956 956 957 RETURN 957 #endif 958 ! of #ifndef CPP_PARA 958 959 END -
trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/calfis_p.F
r1401 r1403 33 33 ! USE IOPHY 34 34 #endif 35 #ifdef CPP_PARA 35 36 USE parallel_lmdz, ONLY : omp_chunk, using_mpi, AllGather_Field 36 37 USE Write_Field 37 38 Use Write_field_p 38 39 USE Times 40 USE cpdet_mod, only: tpot2t_p, t2tpot_p 41 ! used only for zonal averages 42 USE moyzon_mod 43 #endif 39 44 USE infotrac, ONLY: nqtot, niadv, tname 40 45 USE control_mod, ONLY: planet_type, nsplit_phys 41 USE cpdet_mod, only: tpot2t_p, t2tpot_p42 43 ! used only for zonal averages44 USE moyzon_mod45 46 46 47 IMPLICIT NONE … … 147 148 REAL,INTENT(OUT) :: pdpsfi(iip1,jjp1) ! tendency on surface pressure (Pa/s) 148 149 150 #ifdef CPP_PARA 149 151 #ifdef CPP_PHYS 150 152 c Local variables : … … 895 897 . ztfi_omp, 896 898 . zqfi_omp, 897 c#ifdef INCA898 899 . flxwfi_omp, 899 c#endif900 900 . zdufi_omp, 901 901 . zdvfi_omp, … … 1440 1440 #endif 1441 1441 ! of #ifdef CPP_PHYS 1442 RETURN 1442 #endif 1443 ! of #ifdef CPP_PARA 1443 1444 END -
trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/gr_dyn_fi_p.F
r1401 r1403 3 3 ! 4 4 SUBROUTINE gr_dyn_fi_p(nfield,im,jm,ngrid,pdyn,pfi) 5 #ifdef CPP_P HYS5 #ifdef CPP_PARA 6 6 ! Interface with parallel physics, 7 7 USE mod_interface_dyn_phys … … 40 40 c$OMP END DO NOWAIT 41 41 #endif 42 ! of #ifdef CPP_P HYS42 ! of #ifdef CPP_PARA 43 43 RETURN 44 44 END -
trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/gr_fi_dyn_p.F
r1401 r1403 3 3 ! 4 4 SUBROUTINE gr_fi_dyn_p(nfield,ngrid,im,jm,pfi,pdyn) 5 #ifdef CPP_P HYS5 #ifdef CPP_PARA 6 6 ! Interface with parallel physics, 7 7 USE mod_interface_dyn_phys 8 8 USE dimphy 9 useparallel_lmdz9 USE parallel_lmdz 10 10 IMPLICIT NONE 11 11 c======================================================================= … … 52 52 c$OMP END DO NOWAIT 53 53 #endif 54 ! of #ifdef CPP_P HYS54 ! of #ifdef CPP_PARA 55 55 RETURN 56 56 END -
trunk/LMDZ.COMMON/makelmdz
r1391 r1403 79 79 80 80 CPP_KEY="" 81 INCLUDE='-I$(LIBF)/grid -I$(LIBF)/ bibio-I$(LIBF)/filtrez -I. '81 INCLUDE='-I$(LIBF)/grid -I$(LIBF)/misc -I$(LIBF)/filtrez -I. ' 82 82 LIB="" 83 83 adjnt="" … … 86 86 PARA_LD="" 87 87 EXT_SRC="" 88 #src_dirs: directories containing source files 89 src_dirs="grid misc" 88 90 ccompiler="" 89 91 OPTIMC="" … … 116 118 [-chimie INCA/false] : (Earth) with INCA chemistry model or without (default: false) 117 119 [-cosp cosp/false] : (Earth) add the cosp model (default: false) 120 [-sisvat true/false] : (Earth) compile with/without sisvat package (default: false) 121 [-rrtm true/false] : (Earth) compile with/without rrtm package (default: false) 118 122 [-parallel none/mpi/omp/mpi_omp] : parallelism (default: none) : mpi, openmp or mixted mpi_openmp 119 123 [-g GRI] : grid configuration in dyn3d/GRI_xy.h (default: reg, inclues a zoom) … … 292 296 for inc in $archfileline ; do INCLUDE="$INCLUDE `echo $inc | grep '\-I'`" ; done 293 297 298 phys_root=$physique 299 if [[ "${physique:0:3}" == "lmd" ]] ; then phys_root=lmd ; fi 300 if [[ "${physique:0:3}" == "mar" ]] ; then phys_root=mar ; fi 301 if [[ "${physique:0:4}" == "mars" ]] ; then phys_root=mars ; fi 302 if [[ "${physique:0:3}" == "std" ]] ; then phys_root=std ; fi 303 if [[ "${physique:0:5}" == "venus" ]] ; then phys_root=venus ; fi 304 if [[ "${physique:0:5}" == "titan" ]] ; then phys_root=titan ; fi 305 if [[ "${physique:0:3}" == "dev" ]] ; then phys_root=dev ; fi 306 294 307 if [[ "$physique" != "nophys" ]] 295 308 then 309 #We'll use some physics 310 src_dirs="$src_dirs phy$physique" 311 LIBPHY='$(LIBO)/libphy'"$physique"'.a' 312 lib_phy='-lphy'"$physique" 296 313 CPP_KEY="$CPP_KEY CPP_PHYS" 297 fi 298 299 if [[ "$physique" == "lmd" ]] 300 then 301 #Default planet type is Earth 314 if [[ "${phys_root}" == "lmd" ]] 315 then 316 #For lmd physics, default planet type is Earth 302 317 CPP_KEY="$CPP_KEY CPP_EARTH" 318 fi 303 319 fi 304 320 … … 309 325 LIB="$LIB -l${LIBPREFIX}chim$physique" 310 326 opt_dep="$opt_dep chim$physique" 327 src_dirs="$src_dirs chim$physique" 311 328 # get C compiler name and optim from arch.fcm file 312 329 archfileline=$( grep -i '^%C_COMPILER' arch.fcm ) … … 322 339 if [[ -d ${LIBFGCM}/aerono${physique} ]] 323 340 then 341 src_dirs="$src_dirs aerono$physique" 324 342 INCLUDE="$INCLUDE -I${LIBFGCM}/aerono${physique}" 325 343 LIB="$LIB -l${LIBPREFIX}aerono$physique" … … 442 460 CPP_KEY="$CPP_KEY CPP_COSP" 443 461 COSP_PATH="$LIBFGCM/cosp" 462 src_dirs="$src_dirs cosp" 444 463 # LIB="${LIB} -l${LIBPREFIX}cosp" 445 464 opt_dep="$opt_dep cosp" … … 451 470 then 452 471 CPP_KEY="$CPP_KEY CPP_SISVAT" 472 src_dirs="$src_dirs phy${physique}/sisvat" 453 473 fi 454 474 … … 456 476 then 457 477 CPP_KEY="$CPP_KEY CPP_RRTM" 478 src_dirs="$src_dirs phy${physique}/rrtm" 458 479 fi 459 480 … … 507 528 cd $LIBFGCM/grid/dimension 508 529 ./makdim $dim 530 if (($? != 0)) 531 then 532 exit 1 533 fi 534 509 535 cat $LIBFGCM/grid/dimensions.h 510 536 cd $LMDGCM … … 534 560 ######################################################################## 535 561 536 dimension=`echo $dim | wc -w` 537 echo dimension $dimension 538 539 if (( $dimension == 3 )) ; then 562 if (( $dimc == 3 )) ; then 563 src_dirs="$src_dirs $filtre dyn3d_common dyn3d${FLAG_PARA}" 564 if [[ $physique != "nophys" ]] ; then 565 src_dirs="$src_dirs dynlonlat_phylonlat dynlonlat_phylonlat/phy${phys_root}" 566 libdyn_phy="-ldynlonlat_phylonlat" 567 LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a' 568 INCLUDE="$INCLUDE "'-I$(LIBF)/dynlonlat_phylonlat' 569 INCLUDE="$INCLUDE "'-I$(LIBF)/dynlonlat_phylonlat/'"${phys_root}" 570 fi 540 571 cd $LIBFGCM/grid 541 572 \rm fxyprim.h … … 543 574 filtre="FILTRE=$filtre" 544 575 INCLUDE="$INCLUDE "'-I$(LIBF)/dyn3d${FLAG_PARA} -I$(LIBF)/dyn3d_common ' 545 elif (( $dimension == 2 )) ; then 576 elif (( $dimc == 2 )) ; then 577 src_dirs="$src_dirs dyn2d" 546 578 filtre="FILTRE= L_FILTRE= " 547 579 INCLUDE="$INCLUDE "'-I$(LIBF)/dyn2d' 548 elif (( $dim ension== 1 )) ; then580 elif (( $dimc == 1 )) ; then 549 581 echo pas de dynamique 582 src_dirs="$src_dirs phy${physique}/dyn1d" 550 583 CPP_KEY="$CPP_KEY CPP_1D" 551 filtre="L_DYN= DYN= FILTRE= L_FILTRE= DIRMAIN=phy$physique " 552 INCLUDE="$INCLUDE "'-I$(LIBF)/dyn3d -I$(LIBF)/dyn3d_common ' # Pas tres propre 584 filtre="L_DYN= DYN= FILTRE= L_FILTRE= " 585 #INCLUDE="$INCLUDE "'-I$(LIBF)/dyn3d -I$(LIBF)/dyn3d_common ' # Pas tres propre 586 INCLUDE="$INCLUDE "' -I$(LIBF)/phy'"$physique"'/dyn1d' 553 587 else 554 588 echo Dimension dimc=$dimc pas prevu ; exit … … 588 622 ######################################################################## 589 623 cd $LMDGCM 590 find libf -name '*.[Fh]' -print | sort > tmp77 591 find libf -name '*.[Fh]' -exec egrep -i " *use *ioipsl" {} \; -print | sort > tmp90 592 find libf -name '*.F90' -print | sort >> tmp90 624 625 626 if [[ -r .makelmdz ]] 627 then 628 old_lmdz_configuration=$(cat .makelmdz ) 629 else 630 old_lmdz_configuration="" 631 fi 632 lmdz_configuration="$src_dirs" 633 if [[ "$lmdz_configuration" != "$old_lmdz_configuration" ]] 634 then 635 configuration_change="true" 636 else 637 configuration_change="false" 638 fi 639 640 mkdir -p make_dir 641 suf_make=`echo $src_dirs | sed -e 's/\//_/g' -e 's/ /_/g'` 642 echo suf_make $suf_make 643 644 \rm tmp77 tmp90 645 for dir in $src_dirs ; do 646 find libf/$dir -name '*.[Fh]' -print | sort >> tmp77 647 find libf/$dir -name '*.F90' -print | sort >> tmp90 593 648 ######### CAS PARTICULIER CHIMIE TITAN 594 649 if [[ "$physique" == "titan" ]] … … 597 652 fi 598 653 ######### 599 600 if [[ ! ( -r makefile ) || ! ( -r liste_des_sources_f90 ) || ! ( -r liste_des_sources_f77 ) || ` diff tmp77 liste_des_sources_f77 | wc -w ` -ne 0 || ` diff tmp90 liste_des_sources_f90 | wc -w ` -ne 0 ]] 654 done 655 656 liste77=make_dir/liste_des_sources_f77_$suf_make 657 liste90=make_dir/liste_des_sources_f90_$suf_make 658 if [[ "$physique" == "titan" ]] ; then 659 listeC=make_dir/liste_des_sources_C_$suf_make 660 fi 661 makefile=make_dir/makefile_$suf_make 662 663 if [[ $configuration_change == "true" || ! ( -r makefile ) || ! ( -r $liste_90 ) || ! ( -r $liste_77 ) || ` diff tmp77 $liste_77 | wc -w ` -ne 0 || ` diff tmp90 $liste_90 | wc -w ` -ne 0 ]] 601 664 then 602 665 echo "les fichiers suivants ont ete crees ou detruits" 603 666 echo "ou les fichiers suivants sont passes ou ne sont plus en Fortran 90" 604 diff liste_des_sources_f77tmp77605 diff liste_des_sources_f90 tmp90606 \cp -f tmp77 liste_des_sources_f77607 \cp -f tmp90 liste_des_sources_f90667 diff $liste77 tmp77 668 diff $liste90 tmp90 669 \cp -f tmp77 $liste77 670 \cp -f tmp90 $liste90 608 671 ######### CAS PARTICULIER CHIMIE TITAN 609 672 if [[ "$physique" == "titan" ]] 610 673 then 611 diff liste_des_sources_C tmpC612 \cp -f tmpC liste_des_sources_C674 diff $listeC tmpC 675 \cp -f tmpC $listeC 613 676 fi 614 677 ######### 615 echo "on recree le makefile" 616 ./create_make_gcm > tmp 617 \mv -f tmp makefile 618 echo "Nouveau makefile cree" 678 echo "Recreating the makefile" 679 echo "src_dirs: $src_dirs" 680 ./create_make_gcm $src_dirs > tmp 681 \mv -f tmp $makefile 682 echo "New makefile created" 619 683 ######### CAS PARTICULIER CHIMIE TITAN 620 684 else if [[ "$physique" == "titan" ]] 621 685 then 622 if [[ ! ( -r liste_des_sources_C ) || ` diff tmpC liste_des_sources_C | wc -w ` -ne 0 ]]686 if [[ ! ( -r $listeC ) || ` diff tmpC $listeC | wc -w ` -ne 0 ]] 623 687 then 624 diff liste_des_sources_C tmpC625 \cp -f tmpC liste_des_sources_C688 diff $listeC tmpC 689 \cp -f tmpC $listeC 626 690 echo "on recree le makefile" 627 ./create_make_gcm > tmp628 \mv -f tmp makefile691 ./create_make_gcm $src_dirs > tmp 692 \mv -f tmp $makefile 629 693 echo "Nouveau makefile cree" 630 694 fi … … 633 697 fi 634 698 699 ln -sf $makefile makefile 700 701 #Create a .makelmdz file containing main compilation option for later comparisons 702 echo "$lmdz_configuration" > .makelmdz 703 635 704 ################################################################# 636 705 # Preparation de l'execution de la commande make … … 641 710 then 642 711 source_code=${code}.F 643 code_dir=dyn${dimc}d${FLAG_PARA}712 dirmain=dyn${dimc}d${FLAG_PARA} 644 713 else 645 714 if [[ -r $LMDGCM/libf/dyn${dimc}d${FLAG_PARA}/${code}.F90 ]] 646 715 then 647 716 source_code=${code}.F90 648 code_dir=dyn${dimc}d${FLAG_PARA}717 dirmain=dyn${dimc}d${FLAG_PARA} 649 718 else 650 719 if [[ -r $LMDGCM/libf/phy${physique}/${code}.F ]] 651 720 then 652 721 source_code=${code}.F 653 code_dir=phy${physique}722 dirmain=phy${physique} 654 723 else 655 # last possibility:656 724 if [[ -r $LMDGCM/libf/phy${physique}/${code}.F90 ]] 657 725 then 658 726 source_code=${code}.F90 659 code_dir=phy${physique}727 dirmain=phy${physique} 660 728 else 661 echo "Error: cannot find ${code}.F[90]" 662 echo " neither in dyn${dimc}d${FLAG_PARA} nor in phy${physique}" 663 exit 729 if [[ -r $LMDGCM/libf/dynlonlat_phylonlat/phy$phys_root/${code}.F ]] 730 then 731 source_code=${code}.F 732 dirmain="dynlonlat_phylonlat/phy${phys_root}" 733 else 734 if [[ -r $LMDGCM/libf/phy$physique/dyn1d/${code}.F ]] 735 then 736 source_code=${code}.F 737 dirmain=phy$physique/dyn1d 738 else 739 echo "Error: cannot find ${code}.F[90]" 740 echo " neither in dyn${dimc}d${FLAG_PARA} nor in phy${physique}" 741 exit 742 fi 743 fi 664 744 fi 665 745 fi … … 684 764 then 685 765 INCLUDE="$INCLUDE"' -I$(LIBF)/phy'"$physique" 686 phys="PHYS=$physique" 687 else 688 # trick to avoid having a physics-related library in the makefile 689 phys="L_PHY= LIBPHY=" 690 fi 691 if (( $dimension == 1 )) 692 then 693 INCLUDE="$INCLUDE"' -I$(LIBF)/dyn3d -I'${LIBOGCM}/${nomlib} 694 else 695 INCLUDE="$INCLUDE"' -I$(LIBF)/dyn'${dimc}'d'$FLAG_PARA' -I'${LIBOGCM}/${nomlib} 696 fi 766 # phys="PHYS=$physique" 767 #else 768 # # trick to avoid having a physics-related library in the makefile 769 # phys="L_PHY= LIBPHY=" 770 fi 771 INCLUDE="$INCLUDE"' -I'${LIBOGCM}/${nomlib} 772 #if (( $dimension == 1 )) 773 #then 774 # INCLUDE="$INCLUDE"' -I$(LIBF)/dyn3d -I'${LIBOGCM}/${nomlib} 775 #else 776 #INCLUDE="$INCLUDE"' -I$(LIBF)/dyn'${dimc}'d'$FLAG_PARA' -I'${LIBOGCM}/${nomlib} 777 #fi 697 778 698 779 # ranlib utility (check it exists or else default to ls) … … 727 808 $filtre \ 728 809 LIBO=${LIBOGCM}/${nomlib} \ 729 $phys \ 810 "PHYS=$physique" \ 811 LIBPHY=${LIBPHY} \ 812 LIBDYN_PHYS=${LIBDYN_PHYS} \ 730 813 DIM=$dimc \ 731 814 FLAG_PARA=$FLAG_PARA \ 815 L_PHY="$lib_phy" \ 816 L_DYN_PHY="$libdyn_phy" \ 732 817 L_ADJNT=$adjnt \ 733 818 L_COSP="$lcosp" \ … … 744 829 MOD_SUFFIX="mod" \ 745 830 AR=$arcommand \ 746 DIRMAIN=$ code_dir\831 DIRMAIN=$dirmain \ 747 832 SOURCE=$source_code \ 748 833 PROG=$code … … 758 843 $filtre \ 759 844 LIBO=${LIBOGCM}/${nomlib} \ 760 $phys \ 845 "PHYS=$physique" \ 846 LIBPHY=${LIBPHY} \ 847 LIBDYN_PHYS=${LIBDYN_PHYS} \ 761 848 DIM=$dimc \ 762 849 FLAG_PARA=$FLAG_PARA \ 850 L_PHY="$lib_phy" \ 851 L_DYN_PHY="$libdyn_phy" \ 763 852 L_ADJNT="$adjnt" \ 764 853 L_COSP="$lcosp" \ … … 775 864 MOD_SUFFIX="mod" \ 776 865 AR=$arcommand \ 777 DIRMAIN=$ code_dir\866 DIRMAIN=$dirmain \ 778 867 SOURCE=$source_code \ 779 868 PROG=$code -
trunk/LMDZ.COMMON/makelmdz_fcm
r1391 r1403 40 40 LIBOGCM=$LMDGCM/libo 41 41 LIBFGCM=$LMDGCM/libf 42 DYN_COMMON_PATH=$LIBFGCM/dyn3d_common 42 43 # path for optional packages, but default set to ".void_dir" 44 FILTRE_PATH=$LMDGCM/.void_dir 45 DYN_PHYS_PATH=$LMDGCM/.void_dir 46 DYN_PHYS_SUB_PATH=$LMDGCM/.void_dir 43 47 RRTM_PATH=$LMDGCM/.void_dir 44 48 SISVAT_PATH=$LMDGCM/.void_dir … … 87 91 [-chimie INCA/false] : (Earth) with INCA chemistry model or without (default: false) 88 92 [-cosp cosp/false] : (Earth) add the cosp model (default: false) 93 [-sisvat true/false] : (Earth) compile with/without sisvat package (default: false) 94 [-rrtm true/false] : (Earth) compile with/without rrtm package (default: false) 89 95 [-parallel none/mpi/omp/mpi_omp] : parallelism (default: none) : mpi, openmp or mixted mpi_openmp 90 96 [-g GRI] : grid configuration in dyn3d/GRI_xy.h (default: reg, inclues a zoom) … … 236 242 fi 237 243 244 phys_root=$physique 245 if [[ "${physique:0:3}" == "lmd" ]] ; then phys_root=lmd ; fi 246 if [[ "${physique:0:3}" == "mar" ]] ; then phys_root=mar ; fi 247 if [[ "${physique:0:4}" == "mars" ]] ; then phys_root=mars ; fi 248 if [[ "${physique:0:3}" == "std" ]] ; then phys_root=std ; fi 249 if [[ "${physique:0:5}" == "venus" ]] ; then phys_root=venus ; fi 250 if [[ "${physique:0:5}" == "titan" ]] ; then phys_root=titan ; fi 251 if [[ "${physique:0:3}" == "dev" ]] ; then phys_root=dev ; fi 252 238 253 if [[ "$physique" != "nophys" ]] 239 254 then 240 255 #We'll use some physics 241 256 CPP_KEY="$CPP_KEY CPP_PHYS" 242 if [[ "${phys ique:0:3}" == "lmd" ]]257 if [[ "${phys_root}" == "lmd" ]] 243 258 then 244 259 #For lmd physics, default planet type is Earth 245 260 CPP_KEY="$CPP_KEY CPP_EARTH" 246 261 fi 262 # set the dyn/phys interface path 263 DYN_PHYS_PATH="${LIBFGCM}/dynlonlat_phylonlat" 264 DYN_PHYS_SUB_PATH="${LIBFGCM}/dynlonlat_phylonlat/phy${phys_root}" 265 fi 266 267 if [[ "$filtre" == "filtrez" ]] 268 then 269 FILTRE_PATH=${LIBFGCM}/$filtre 247 270 fi 248 271 … … 360 383 fi 361 384 362 if [[ "$physique" == "titan" ]] 385 # for Titan (but could be used by others as well), there is also "chimtitan" 386 if [[ -d ${LIBFGCM}/chim${physique} ]] 363 387 then 364 388 CHEM_PATH="${LIBFGCM}/chim${physique}" … … 463 487 if (( $dimension == 1 )) 464 488 then 489 CPP_KEY="$CPP_KEY CPP_1D" 465 490 ##in 1D, add dyn3d to include path (because main prog is in physics) 466 INCLUDE="$INCLUDE -Ilibf/dyn3d" 467 # echo pas de dynamique 468 # dyn="DYN= L_DYN=-ldyn3d " 491 INCLUDE="$INCLUDE -Ilibf/dyn3d -Ilibf/dyn3d_common" 492 ## no filtre in 1d: 493 FILTRE_PATH=$LMDGCM/.void_dir 494 ## no need to compile all routines in dyn3d_common either: 495 DYN_COMMON_PATH=$LMDGCM/.void_dir 496 ## no need to compile all routines in dynlmdz_phy... ; 497 ## (because key ones are included in 1D main program) 498 DYN_PHYS_PATH=$LMDGCM/.void_dir 499 DYN_PHYS_SUB_PATH=$LMDGCM/.void_dir 469 500 fi 470 501 … … 523 554 else 524 555 SUFF_NAME=${SUFF_NAME}_seq 525 DYN=dyn${dimc}d 526 ## specific stuff for 1D model (needs includes which are in dyn3d) 527 if (( $dimension == 1 )) ; then 528 SUFF_NAME=${SUFF_NAME} 529 DYN=dyn3d 556 if (( $dimension == 1 )) 557 then 558 # dynamics-related routines in"dyn1d" subdirectory of phy${physique} 559 DYN=phy${physique}/dyn1d 560 else 561 DYN=dyn${dimc}d 530 562 fi 531 563 fi … … 561 593 echo "%LIBO $LIBOGCM" >> $config_fcm 562 594 echo "%DYN $DYN" >> $config_fcm 595 echo "%DYN_COMMON $DYN_COMMON_PATH" >> $config_fcm 596 echo "%FILTRE $FILTRE_PATH" >> $config_fcm 563 597 echo "%PHYS phy${physique}" >> $config_fcm 598 echo "%DYN_PHYS $DYN_PHYS_PATH" >> $config_fcm 599 echo "%DYN_PHYS_SUB $DYN_PHYS_SUB_PATH" >> $config_fcm 564 600 echo "%RRTM $RRTM_PATH" >> $config_fcm 565 601 echo "%SISVAT $SISVAT_PATH" >> $config_fcm … … 594 630 ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config/tmp tmp_src 595 631 596 #eventual cleanup for SISVAT597 #sed -e 's/^src::sisvat/#src::sisvat/' bld.cfg > bld.tmp598 #mv bld.tmp bld.cfg599 600 #eventual cleanup for RRTM601 #sed -e 's/^src::rrtm/#src::rrtm/' bld.cfg > bld.tmp602 #mv bld.tmp bld.cfg603 604 632 605 633 if [[ -r $LIBFGCM/grid/dimensions.h ]]
Note: See TracChangeset
for help on using the changeset viewer.