Changeset 1403
- Timestamp:
- Mar 31, 2015, 3:49:07 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 116 added
- 13 deleted
- 32 edited
- 6 copied
- 88 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/DOC/chantiers/commit_importants.log
r1395 r1403 1496 1496 **** commit_v1395 **** 1497 1497 ********************** 1498 Ehouarn: some cleanup and t ydying on the dynamics/physics interface.1498 Ehouarn: some cleanup and tidying on the dynamics/physics interface. 1499 1499 Essentially affects the "iniphysiq" routine in all physics packages. 1500 1501 ********************** 1502 **** commit_v1403 **** 1503 ********************** 1504 Ehouarn: Reorganizing the physics/dynamics interface. 1505 1506 * makelmdz and makelmdz_fcm scripts adapted to handle the new directory 1507 settings 1508 1509 * misc: (replaces what was the "bibio" directory) 1510 - Should only contain extremely generic (and non physics or 1511 dynamics-specific) routines 1512 - Therefore moved initdynav.F90, initfluxsto.F, inithist.F, writedynav.F90, 1513 write_field.F90, writehist.F to "dyn3d_common" 1514 1515 * dynlonlat_phylonlat: (new interface directory) 1516 - This directory contains routines relevent to physics/dynamics grid 1517 interactions, e.g. routines gr_dyn_fi or gr_fi_dyn and calfis 1518 - Moreover the dynlonlat_phylonlat contains directories "phy***" corresponding 1519 to each physics package "phy***" to be used. These subdirectories should 1520 only contain specific interfaces (e.g. iniphysiq) or main programs (e.g. 1521 newstart) 1522 1523 * phy***/dyn1d: this subdirectory contains the 1D model using physics 1524 from phy*** -
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 ]] -
trunk/LMDZ.GENERIC/README
r1384 r1403 1054 1054 == 04/03/2015 == EM 1055 1055 - Some code cleanup: turning comcstfi.h into module comcstfi_mod 1056 1057 == 31/03/2015 == EM 1058 - Reorganizing the physics/dynamics interface, for better compatibility 1059 between models and with the parallel LMDZ.COMMON dyn core. Main structural 1060 changes are: 1061 * misc: (replaces what was the "bibio" directory) 1062 - Should only contain extremely generic (and non physics or 1063 dynamics-specific) routines 1064 * dynlonlat_phylonlat: (new interface directory) 1065 - This directory contains routines relevent to physics/dynamics grid 1066 interactions, e.g. routines gr_dyn_fi or gr_fi_dyn and calfis 1067 - Moreover the dynlonlat_phylonlat contains directory "phystd". 1068 This subdirectories should only contain specific interfaces (e.g. 1069 iniphysiq) or main programs (e.g. newstart). 1070 * phystd/dyn1d: this subdirectory contains the 1D models. -
trunk/LMDZ.GENERIC/create_make_gcm
r634 r1403 11 11 # ., dyn3d and grid 12 12 # 13 14 # arguments given to create_make_gcm are the directories to scan 15 src_dirs=$* 16 13 17 machine=`hostname` 14 18 os=`uname` 15 19 gcm=`pwd` 20 logfile=$gcm/create_make_gcm.log 21 rm -f $logfile ; touch -f $logfile 16 22 libf=$gcm/libf 17 23 libo=$gcm/libo … … 51 57 #echo $localdir 52 58 echo "LOCAL_DIR=`echo $localdir`" 53 echo ' BIBIO = $(LIBF)/bibio'54 # #echo 'AERONOMARS = $(LIBF)/aeronomars'59 echo 'MISC = $(LIBF)/misc' 60 #echo 'AERONOMARS = $(LIBF)/aeronomars' 55 61 echo "FILTRE = filtre" 56 62 echo "PHYS = " 57 63 echo 'DYN = $(DYNTYPE)' 58 64 echo 'LIBPHY = $(LIBO)/libphy$(PHYS).a' 65 echo 'LIBDYN_PHY = $(LIBO)/libdynlmdz_phy$(PHYS).a' 59 66 echo 'DIRMAIN= $(DYN)$(DIM)d' 60 67 echo 'RM=rm' … … 64 71 echo '# Les differentes librairies pour l"edition des liens:' 65 72 echo 66 if [ "$XNEC" = '1' ] ; then 67 echo 'dyn3d = $(LIBO)/libsxdyn3d.a $(LIBO)/libsx$(FILTRE).a' 68 echo 'dyn2d = $(LIBO)/libsxdyn2d.a' 69 echo 'dyn1d = $(LIBO)/libsxdyn1d.a' 70 echo 'L_DYN = -lsxdyn$(DIM)d' 71 echo 'L_FILTRE = -lsx$(FILTRE)' 72 echo 'L_PHY = -lsxphy$(PHYS) ' 73 echo 'L_BIBIO = -lsxbibio' 74 ## echo 'L_AERONOMARS = -lsxaeronomars' 75 echo 'L_ADJNT =' 76 else 77 echo 'dyn3d = $(LIBO)/libdyn3d.a $(LIBO)/lib$(FILTRE).a' 78 echo 'dyn2d = $(LIBO)/libdyn2d.a' 79 echo 'dyn1d = $(LIBO)/libdyn1d.a' 80 echo 'L_DYN = -l$(DYN)$(DIM)d' 81 echo 'L_FILTRE = -l$(FILTRE)' 82 echo 'L_PHY = -lphy$(PHYS) ' 83 echo 'L_BIBIO = -lbibio' 84 ## echo 'L_AERONOMARS = -laeronomars' 85 echo 'L_ADJNT =' 86 fi 73 echo 'L_DYN = -ldyn$(DIM)d' 74 echo 'L_FILTRE = -l$(FILTRE)' 75 echo 'L_DYN_PHY = -ldynlmdz_phy$(PHYS) ' 76 echo 'L_PHY = -lphy$(PHYS) ' 77 echo 'L_MISC = -lmisc' 78 #echo 'L_AERONOMARS = -laeronomars' 79 echo 'L_ADJNT =' 87 80 echo 88 81 echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" … … 105 98 echo 106 99 echo "PROG = code" 107 echo 108 ##echo 'main : $(DYN) bibio phys aeronomars $(OPTION_DEP) ' 109 echo 'main : $(DYN) bibio phys$(OPTION_DEP) '100 echo 'DYN = dyn$(DIM)d' 101 echo 102 echo 'main : $(DYN) misc phys dyn_phy $(OPTION_DEP) ' 110 103 echo ' cd $(LIBO) ; $(RANLIB) lib*.a ; cd $(GCM) ;\' 111 104 echo ' cd $(LOCAL_DIR); \' 112 105 echo ' $(COMPILE90) $(LIBF)/$(DIRMAIN)/$(SOURCE) -o $(PROG).o ; \' 113 106 if [ "$CRAY" = '0' ] ; then 114 ##echo ' $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ADJNT) $(L_FILTRE) $(L_AERONOMARS) $(L_PHY) $(L_BIBIO) $(L_DYN) $(L_AERONOMARS) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o ' 115 echo ' $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ADJNT) $(L_FILTRE) $(L_PHY) $(L_BIBIO) $(L_DYN) $(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_FILTRE) $(L_PHY) $(L_DYN_PHY) $(L_MISC) $(L_DYN) $(L_PHY) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o ' 116 108 else 117 ##echo ' $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ADJNT) $(L_FILTRE) $(L_AERONOMARS) $(L_PHY) $(L_BIBIO) $(L_DYN) $(L_AERONOMARS) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o ' 118 echo ' $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ADJNT) $(L_FILTRE) $(L_PHY) $(L_BIBIO) $(L_DYN) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o ' 109 echo ' $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_DYN_PHY) $(L_ADJNT) $(L_FILTRE) $(L_PHY) $(L_DYN_PHY) $(L_MISC) $(L_DYN) $(L_PHY) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o ' 119 110 fi 120 111 echo … … 125 116 echo 'phys : $(LIBPHY)' 126 117 echo 127 echo 'bibio : $(LIBO)/libbibio.a' 128 echo 129 ##echo 'aeronomars : $(LIBO)/libaeronomars.a' 130 ##echo 118 echo 'dyn3d : $(LIBO)/libdyn3d.a $(LIBO)/lib$(FILTRE).a' 119 echo 'dyn2d : $(LIBO)/libdyn2d.a' 120 echo 'dyn1d : ' 121 echo 122 echo 'dyn_phy: $(LIBDYN_PHYS)' 123 echo 124 echo 'misc : $(LIBO)/libmisc.a' 125 echo 126 #echo 'aeronomars : $(LIBO)/libaeronomars.a' 127 #echo 131 128 echo 'adjnt : $(LIBO)/libadjnt.a' 132 129 echo … … 143 140 echo 144 141 cd $libf >/dev/null 2>&1 145 for diri in ` ls ` 146 do 142 143 for diri in $src_dirs ; do 144 147 145 if [ -d $diri ] ; then 148 if [ "`ls $diri/*.F`" != "" ] || [ "`ls $diri/*. F90`" != "" ] ; then149 cd $diri >/dev/null 2>&1146 if [ "`ls $diri/*.F`" != "" ] || [ "`ls $diri/*.[fF]90`" != "" ] ; then 147 # cd $diri >/dev/null 2>&1 150 148 echo 151 149 listlib="" 152 for i in `ls *.F` 153 do 154 fili=`basename $i .F` 150 # Liste des fichiers .F et .F90 n'etant pas des programmes principaux 151 for fili in `ls $diri/*.[fF]` ; do 155 152 # Check if file is a routine or main program 156 153 # i.e: look for the "program" keword preceeded by leading spaces 157 test=` ( head $i | grep -i '^ *program' ) ` 158 if [ "$test" = "" ] ; then 159 # if it is not a main program, add it to the list 160 listlib=$listlib" "$fili 161 fi 162 done 163 for i in `ls *.F90` 164 do 165 fili=`basename $i .F90` 154 test=` ( head $fili | grep -i '^ *program' ) ` 155 # if it is not a main program, add it to the list 156 if [ "$test" = "" ] ; then listlib=$listlib" "$fili ; fi 157 done 158 for fili in `ls $diri/*.[fF]90` ; do 166 159 # Check if file is a routine or main program 167 160 # i.e. look for "program" keyword (with possibly some leading spaces) 168 test=` ( head $ i | grep -i '^ \{0,\}program' ) `169 if [ "$test" = "" ] ; then170 # if it is not a main program, add it to the list171 listlib=$listlib" "$fili172 fi173 done174 # 175 echo176 echo177 echo "#================================================================== ====="161 test=` ( head $fili | grep -i '^ \{0,\}program' ) ` 162 # if it is not a main program, add it to the list 163 if [ "$test" = "" ] ; then listlib=$listlib" "$fili ; fi 164 done 165 echo 166 echo $listlib >> $logfile 167 echo 168 # topdiri contains main dir name (without trailing "/blabla" for subdirs) 169 topdiri=${diri%/*} 170 echo "#==================================================================" 178 171 echo "# Contenu de la bibliotheque correspondant au Directory "$diri 179 echo "#================================================================== ====="180 echo 181 for fili in $listlib182 do183 echo '$(LIBO)/lib'$ diri".a : " '$(LIBO)/lib'$diri".a("$fili".o)"172 echo "#==================================================================" 173 echo 174 for trufile in $listlib ; do 175 fili=`echo $trufile | awk -F/ ' { print $NF } ' | cut -d. -f1` 176 echo '$(LIBO)/lib'$topdiri".a : " '$(LIBO)/lib'$topdiri".a("$fili".o)" 184 177 echo 185 178 done 186 echo '.PRECIOUS : $(LIBO)/lib'$diri'.a' 187 echo 188 echo 189 echo "# Compilation des membres de la bibliotheque lib"$diri".a" 190 echo 191 for fili in $listlib 192 do 193 if [ -f $fili.F90 ] ; then 194 trufile=$fili.F90 195 else 196 trufile=$fili.F 197 fi 179 echo '.PRECIOUS : $(LIBO)/lib'$topdiri'.a' 180 echo 181 echo 182 echo "# Compilation of elements in $diri of library lib"$topdiri".a" 183 echo 184 for trufile in $listlib ; do 185 fili=`echo $trufile | awk -F/ ' { print $NF } ' | cut -d. -f1` 198 186 F90=0 ; egrep -i '^ *use ' $trufile > /dev/null 2>&1 && F90=1 199 187 egrep -i '^ *module ' $trufile > /dev/null 2>&1 && F90=1 200 188 egrep -i '#include*.inc ' $trufile > /dev/null 2>&1 && F90=1 201 str1='$(LIBO)/lib'$diri'.a('$fili'.o) : $(LIBF)/'$diri/$trufile 202 [ "$fili" = "chem.subs" ] && str1=$str1' $(LIBF)/'$diri/chem.mods.F 203 for stri in ` ( sed -n "/\#include/s/\#include//p" $trufile | sed 's/\"//g' ; egrep -i '^ *use ' $trufile | sed -e 's/,/ /' | awk ' { print $2 } ' ) ` 204 do 205 stri=`echo $stri | tr [A-Z] [a-z]` 206 if [ -f $stri ] ; then 189 str1='$(LIBO)/lib'$topdiri'.a('$fili'.o) : $(LIBF)/'$trufile 190 [ "$fili" = "$diri/chem.subs" ] && str1=$str1' $(LIBF)/'$diri/chem.mods.F 191 192 ########################################################################## 193 # TRAITEMENT DES DEPENDANCES 194 # Differents cas de dependance correspondant a des include ou des 195 # use module. 196 # soit dans le repertoire local soit dans un autre. 197 # Pour dyn3d, il faudrait remplacer la chaine de caractere par $DYN 198 # ou quelque chose du genre. 199 ########################################################################## 200 201 for stri in ` ( sed -e '/^[cC\!]/d' $trufile | sed -e "/\#include /s/\#include /XXnclude /" -e "/include /s/include /XXnclude /" -e "/INCLUDE /s/INCLUDE /XXnclude /" | sed -n "/XXnclude /s/XXnclude//p" | sed 's/\"//g' | sort | uniq ; sed -e '/^[cC\!]/d' $trufile | egrep -i '^ *use ' | sed -e 's/,/ /' | awk ' { print $2 } ' | sort | uniq ) ` ; do 202 echo $trufile $fili $stri >> $logfile 203 strj=`echo $stri | tr [A-Z] [a-z]` 204 str2="" 205 for dirinc in $src_dirs ; do 206 # Recherche dans l'ordre hierarchique inverse car seule la derniere 207 # ligne est conservee 208 # if [ $dirinc = phydev ] ; then 209 # dirstr='$(PHYS)' 210 # libstr='phy$(PHYS)' 211 # else 212 dirstr=$dirinc 213 libstr=$dirinc 214 # fi 215 echo dirinc $dirinc >> $logfile 216 if [ -f $dirinc/$stri ] ; then 217 str2='$(LIBF)/'$dirstr/$stri 218 elif [ -f $dirinc/$strj ] ; then 219 str2='$(LIBF)/'$dirstr/$stri 220 elif [ -f $dirinc/$strj.[fF]90 ] || [ -f $dirinc/$strj.[fF] ] ; then 221 strlib=`echo $libstr | awk -F/ ' { print $1 } '` 222 str2='$(LIBO)/lib'$strlib'.a('$strj'.o)' 223 elif [ -f $dirinc/$stri.[fF]90 ] || [ -f $dirinc/$stri.[fF] ] ; then 224 strlib=`echo $libstr | awk -F/ ' { print $1 } '` 225 str2='$(LIBO)/lib'$strlib'.a('$stri'.o)' 226 fi 227 echo stri $stri >> $logfile 228 echo str2 $str2 >> $logfile 229 done 230 echo dernier str2 $str2 >> $logfile 231 if [ "$str2" = "" ] ; then 232 echo Warn: Include $diri $trufile $fili $stri pas trouve >> $logfile 233 elif [ "$str2" = "$str1" ] ; then 234 echo Warn: Include $diri $trufile $fili $stri $str1 trouve 2x >> $logfile 235 else 207 236 echo $str1 \\ 208 str1='$(LIBF)/'$diri'/'$stri 209 else 210 if [ -f $stri.F ] || [ -f $stri.F90 ] ; then 211 echo $str1 \\ 212 str1='$(LIBO)/lib'$diri'.a('$stri'.o)' 213 else 214 # for dirinc in dyn3d grid bibio aeronomars phymars 215 for dirinc in $* 216 do 217 if [ -f ../$dirinc/$stri ] ; then 218 echo $str1 \\ 219 str1='$(LIBF)/'`cd .. ; ls */$stri | head -1` 220 fi 221 if [ -f ../$dirinc/$stri.F90 ] ; then 222 echo $str1 \\ 223 str1='$(LIBO)/lib'$dirinc'.a('$stri'.o)' 224 fi 225 done 226 fi 237 str1=$str2 227 238 fi 228 done 239 done # Fin de la boucle sur les dependances et ecriture de la derniere 229 240 echo $str1 230 # Compile in L OCAL_DIR directory, and before compiling,231 # remove the object from thelibrary232 echo ' cd $(L OCAL_DIR); \'233 echo ' $(AR) d $(LIBO)/lib'$ diri'.a '$fili'.o ; \'241 # Compile in LIBO directory; and before compiling, remove 242 # object from library 243 echo ' cd $(LIBO); \' 244 echo ' $(AR) d $(LIBO)/lib'$topdiri'.a '$fili'.o ; \' 234 245 if [ "$F90" -eq '0' ] ; then 235 236 echo ' $(COMPILE) $(LIBF)/'$diri'/'$trufile' ; \'246 ## Fixed Form Fortran 77 247 echo ' $(COMPILE) $(LIBF)/'$trufile' ; \' 237 248 else 238 249 ## Fortran 90 239 if [ -f $fili.F90 ] ; then240 ## Free Form Fortran 90241 echo ' $(COMPTRU90) $(LIBF)/'$ diri'/'$trufile' ; \'250 if [ `echo $trufile | cut -d. -f2` = F90 ] ; then 251 ## Free Form 252 echo ' $(COMPTRU90) $(LIBF)/'$trufile' ; \' 242 253 else 243 ## Fixed Form Fortran 90 244 echo ' $(COMPILE90) $(LIBF)/'$diri'/'$trufile' ; \' 254 echo ' $(COMPILE90) $(LIBF)/'$trufile' ; \' 245 255 fi 246 ## If a module, handle created module descriptor file247 MODU=0; egrep -i '^ *module ' $trufile> /dev/null 2>&1 && MODU=1248 if [ "$MODU" -eq '1' -a "$CRAY" != '1' ] ; then249 if [ "$os" = 'UNIX_System_V' ] ; then250 echo ' cp $(MOD_LOC_DIR)/*.$(MOD_SUFFIX) $(LIBO)/ ; \'251 else252 echo ' mv $(MOD_LOC_DIR)/'$fili'.$(MOD_SUFFIX) $(LIBO)/'$fili'.$(MOD_SUFFIX) ; \'253 # echo ' if [ "$(MOD_LOC_DIR)" ne "$(LIBO)" ] ; then mv $(MOD_LOC_DIR)/'*'.$(MOD_SUFFIX) $(LIBO) ; fi ; \'254 fi255 fi256 256 fi 257 if ( [ "$XNEC" -eq '1' ] || [ "$X6NEC" = '1' ] || [ "$X8BRODIE" = '1' ] ) ; then258 echo ' sxar r $(LIBO)/libsx'$diri'.a '$fili'.o ; \'259 fi260 257 # Put generated object in library 261 echo ' $(AR) r $(LIBO)/lib'$diri'.a '$fili'.o ; $(RM) '$fili'.o ; \' 262 echo ' cd $(GCM)' 258 echo ' $(AR) r $(LIBO)/lib'$topdiri'.a '$fili'.o ; $(RM) '$fili'.o ; \' 263 259 echo 264 260 done -
trunk/LMDZ.GENERIC/libf/dyn3d/gcm.F
r1395 r1403 6 6 & iconser, ecritphy, idissip 7 7 ! use comgeomphy, only: initcomgeomphy 8 use filtreg_mod, only: inifilr 8 9 IMPLICIT NONE 9 10 … … 106 107 107 108 EXTERNAL caldyn, traceur 108 EXTERNAL dissip,geopot,iniconst ,inifilr109 EXTERNAL dissip,geopot,iniconst 109 110 EXTERNAL integrd,SCOPY 110 111 EXTERNAL inigeom -
trunk/LMDZ.GENERIC/libf/dyn3d/logic.h
r1216 r1403 1 c-----------------------------------------------------------------------2 cINCLUDE 'logic.h'1 !----------------------------------------------------------------------- 2 ! INCLUDE 'logic.h' 3 3 4 COMMON/logic/ purmats,physic,forward,leapf,apphys,grireg, 5 * statcl,conser,apdiss,apdelq,saison,ecripar,fxyhypb,ysinus,4 COMMON/logic/ purmats,physic,forward,leapf,apphys,grireg, & 5 & statcl,conser,apdiss,apdelq,saison,ecripar,fxyhypb,ysinus, & 6 6 & hybrid,autozlevs 7 7 8 LOGICAL purmats,physic,forward,leapf,apphys,grireg,statcl,conser, 9 *apdiss,apdelq,saison,ecripar,fxyhypb,ysinus,hybrid,autozlevs8 LOGICAL purmats,physic,forward,leapf,apphys,grireg,statcl,conser, & 9 & apdiss,apdelq,saison,ecripar,fxyhypb,ysinus,hybrid,autozlevs 10 10 11 c-----------------------------------------------------------------------11 !----------------------------------------------------------------------- -
trunk/LMDZ.GENERIC/libf/dyn3d/serre.h
r135 r1403 1 c..include serre.h2 c 3 REAL clon,clat,transx,transy,alphax,alphay,pxo,pyo, 4 ,grossismx, grossismy, dzoomx, dzoomy,taux,tauy5 COMMON/serre/clon,clat,transx,transy,alphax,alphay,pxo,pyo , 6 ,grossismx, grossismy, dzoomx, dzoomy,taux,tauy1 !..include serre.h 2 ! 3 REAL clon,clat,transx,transy,alphax,alphay,pxo,pyo, & 4 & grossismx, grossismy, dzoomx, dzoomy,taux,tauy 5 COMMON/serre/clon,clat,transx,transy,alphax,alphay,pxo,pyo , & 6 & grossismx, grossismy, dzoomx, dzoomy,taux,tauy -
trunk/LMDZ.GENERIC/libf/dynlonlat_phylonlat/phystd/datareadnc.F
r1401 r1403 188 188 c initialisation 189 189 c----------------------------------------------------------------------- 190 call initial0(iimp1*jjp1,pfield)191 call initial0(imd*jmdp1,zdata)192 call initial0(imdp1*jmdp1,zdataS)190 pfield(1:iimp1*jjp1)=0 191 zdata(1:imd*jmdp1)=0 192 zdataS(1:iimp1*jjp1)=0 193 193 194 194 c----------------------------------------------------------------------- … … 208 208 if (k.eq.4) then 209 209 210 call multscal(imd*jmdp1,zdata,1000.,zdata)211 call multscal(imd,longitude,pi/180.,longitude)212 call multscal(jmdp1,latitude,pi/180.,latitude)210 zdata(:)=1000.*zdata(:) 211 longitude(:)=(pi/180.)*longitude(:) 212 latitude(:)=(pi/180.)*latitude(:) 213 213 214 214 call grid_noro1(360, 180, longitude, latitude, zdata, … … 261 261 elseif (k.eq.3) then ! relief 262 262 if (relief.eq.'pla') then 263 call initial0(iimp1*jjp1,phisinit)263 phisinit(1:iimp1*jjp1)=0 264 264 else 265 do i=1,iimp1*jjp1 266 phisinit(i) = pfield(i) 267 enddo 265 phisinit(1:iimp1*jjp1)=pfield(1:iimp1*jjp1) 268 266 endif 269 267 endif … … 275 273 c----------------------------------------------------------------------- 276 274 277 DO i=1,iimp1*jjp1 278 phisinit(i)=1000.*phisinit(i) 279 ENDDO 275 phisinit(1:iimp1*jjp1)=1000.*phisinit(1:iimp1*jjp1) 280 276 !CALL dump2d(iimp1,jjp1,phisinit,'Altitude en m') 281 CALL multscal(iimp1*jjp1,phisinit,g,phisinit)277 phisinit(:)=g*phisinit(:) 282 278 283 279 c----------------------------------------------------------------------- -
trunk/LMDZ.GENERIC/libf/dynlonlat_phylonlat/phystd/newstart.F
r1401 r1403 30 30 use comgeomphy, only: initcomgeomphy 31 31 use slab_ice_h, only:noceanmx 32 use filtreg_mod, only: inifilr 32 33 implicit none 33 34 -
trunk/LMDZ.GENERIC/libf/dynlonlat_phylonlat/phystd/start2archive.F
r1401 r1403 29 29 USE planete_mod, only: year_day 30 30 USE callkeys_mod, ONLY: ok_slab_ocean 31 31 use filtreg_mod, only: inifilr 32 32 implicit none 33 33 -
trunk/LMDZ.GENERIC/libf/filtrez/coefils.h
r135 r1403 1 COMMON/coefils/jfiltnu,jfiltsu,jfiltnv,jfiltsv,sddu(iim),sddv(iim) 2 * ,unsddu(iim),unsddv(iim),coefilu(iim,jjm),coefilv(iim,jjm),3 * modfrstu(jjm),modfrstv(jjm),eignfnu(iim,iim),eignfnv(iim,iim)4 *,coefilu2(iim,jjm),coefilv2(iim,jjm)5 c1 COMMON/coefils/jfiltnu,jfiltsu,jfiltnv,jfiltsv,sddu(iim),sddv(iim)& 2 & ,unsddu(iim),unsddv(iim),coefilu(iim,jjm),coefilv(iim,jjm), & 3 & modfrstu(jjm),modfrstv(jjm),eignfnu(iim,iim),eignfnv(iim,iim) & 4 & ,coefilu2(iim,jjm),coefilv2(iim,jjm) 5 !c 6 6 INTEGER jfiltnu,jfiltsu,jfiltnv,jfiltsv,modfrstu,modfrstv 7 7 REAL sddu,sddv,unsddu,unsddv,coefilu,coefilv,eignfnu,eignfnv -
trunk/LMDZ.GENERIC/libf/filtrez/filtreg_mod.F90
r1401 r1403 1 MODULE filtreg_mod 2 3 CONTAINS 4 1 5 SUBROUTINE inifilr 2 c 3 c... H. Upadhyaya, O.Sharma ...4 c 6 ! 7 ! ... H. Upadhyaya, O.Sharma ... 8 ! 5 9 IMPLICIT NONE 6 c 7 cversion 3 .....8 9 cCorrection le 28/10/97 P. Le Van .10 c-------------------------------------------------------------------10 ! 11 ! version 3 ..... 12 13 ! Correction le 28/10/97 P. Le Van . 14 ! ------------------------------------------------------------------- 11 15 #include "dimensions.h" 12 16 #include "paramet.h" 13 17 #include "parafilt.h" 14 c-------------------------------------------------------------------18 ! ------------------------------------------------------------------- 15 19 #include "comgeom.h" 16 20 #include "coefils.h" … … 20 24 REAL dlonu(iim),dlatu(jjm) 21 25 REAL rlamda( iim ), eignvl( iim ) 22 c 26 ! 23 27 24 28 REAL lamdamax,pi,cof … … 26 30 REAL dymin,dxmin,colat0 27 31 REAL eignft(iim,iim), coff 28 REAL matriceun,matriceus,matricevn,matricevs,matrinvn,matrinvs 29 COMMON/matrfil/matriceun(iim,iim,nfilun),matriceus(iim,iim,nfilus) 30 , , matricevn(iim,iim,nfilvn),matricevs(iim,iim,nfilvs)31 ,, matrinvn(iim,iim,nfilun),matrinvs (iim,iim,nfilus)32 REAL matriceun,matriceus,matricevn,matricevs,matrinvn,matrinvs 33 COMMON/matrfil/matriceun(iim,iim,nfilun),matriceus(iim,iim,nfilus) & 34 , matricevn(iim,iim,nfilvn),matricevs(iim,iim,nfilvs) & 35 , matrinvn(iim,iim,nfilun),matrinvs (iim,iim,nfilus) 32 36 #ifdef CRAY 33 37 INTEGER ISMIN … … 37 41 #endif 38 42 EXTERNAL inifgn 39 c 40 c------------------------------------------------------------41 cThis routine computes the eigenfunctions of the laplacien42 con the stretched grid, and the filtering coefficients43 c44 cWe designate:45 ceignfn eigenfunctions of the discrete laplacien46 ceigenvl eigenvalues47 cjfiltn indexof the last scalar line filtered in NH48 cjfilts index of the first line filtered in SH49 cmodfrst index of the mode from where modes are filtered50 cmodemax maximum number of modes ( im )51 ccoefil filtering coefficients ( lamda_max*cos(rlat)/lamda )52 csdd SQRT( dx )53 c54 cthe modes are filtered from modfrst to modemax55 c56 c-----------------------------------------------------------57 c 43 ! 44 ! ------------------------------------------------------------ 45 ! This routine computes the eigenfunctions of the laplacien 46 ! on the stretched grid, and the filtering coefficients 47 ! 48 ! We designate: 49 ! eignfn eigenfunctions of the discrete laplacien 50 ! eigenvl eigenvalues 51 ! jfiltn indexof the last scalar line filtered in NH 52 ! jfilts index of the first line filtered in SH 53 ! modfrst index of the mode from where modes are filtered 54 ! modemax maximum number of modes ( im ) 55 ! coefil filtering coefficients ( lamda_max*cos(rlat)/lamda ) 56 ! sdd SQRT( dx ) 57 ! 58 ! the modes are filtered from modfrst to modemax 59 60 !----------------------------------------------------------- 61 ! 58 62 59 63 pi = 2. * ASIN( 1. ) … … 62 66 dlonu(i) = xprimu( i ) 63 67 ENDDO 64 c 68 ! 65 69 CALL inifgn(eignvl) 66 c 70 ! 67 71 print *,' EIGNVL ' 68 72 PRINT 250,eignvl 69 73 250 FORMAT( 1x,5e13.6) 70 c 71 ccompute eigenvalues and eigenfunctions72 c 73 c 74 c.................................................................75 c 76 ccompute the filtering coefficients for scalar lines and77 cmeridional wind v-lines78 c 79 cwe filter all those latitude lines where coefil < 180 cNO FILTERING AT POLES81 c 82 ccolat0 is to be used when alpha (stretching coefficient)83 cis set equal to zero for the regular grid case84 c 85 c....... Calcul de colat0 .........86 c..... colat0 = minimum de ( 0.5, min dy/ min dx ) ...87 c 88 c 74 ! 75 ! compute eigenvalues and eigenfunctions 76 ! 77 ! 78 !................................................................. 79 ! 80 ! compute the filtering coefficients for scalar lines and 81 ! meridional wind v-lines 82 ! 83 ! we filter all those latitude lines where coefil < 1 84 ! NO FILTERING AT POLES 85 ! 86 ! colat0 is to be used when alpha (stretching coefficient) 87 ! is set equal to zero for the regular grid case 88 ! 89 ! ....... Calcul de colat0 ......... 90 ! ..... colat0 = minimum de ( 0.5, min dy/ min dx ) ... 91 ! 92 ! 89 93 DO 45 j = 1,jjm 90 94 dlatu( j ) = rlatu( j ) - rlatu( j+1 ) 91 95 45 CONTINUE 92 c 96 ! 93 97 #ifdef CRAY 94 98 iymin = ISMIN( jjm, dlatu, 1 ) … … 106 110 ENDDO 107 111 #endif 108 c 109 c 112 ! 113 ! 110 114 colat0 = MIN( 0.5, dymin/dxmin ) 111 c 115 ! 112 116 IF( .NOT.fxyhypb.AND.ysinus ) THEN 113 117 colat0 = 0.6 114 c...... a revoir pour ysinus ! .......118 ! ...... a revoir pour ysinus ! ....... 115 119 alphax = 0. 116 120 ENDIF 117 c 121 ! 118 122 PRINT 50, colat0,alphax 119 123 50 FORMAT(/15x,' Inifilr colat0 alphax ',2e16.7) 120 c 124 ! 121 125 IF(alphax.EQ.1. ) THEN 122 126 PRINT *,' Inifilr alphax doit etre < a 1. Corriger ' 123 127 STOP 124 128 ENDIF 125 c 129 ! 126 130 lamdamax = iim / ( pi * colat0 * ( 1. - alphax ) ) 127 131 128 cc ... Correction le 28/10/97 ( P.Le Van ) ..129 c 132 !c ... Correction le 28/10/97 ( P.Le Van ) .. 133 ! 130 134 DO 71 i = 2,iim 131 135 rlamda( i ) = lamdamax/ SQRT( ABS( eignvl(i) ) ) 132 136 71 CONTINUE 133 c 137 ! 134 138 135 139 DO 72 j = 1,jjm … … 142 146 72 CONTINUE 143 147 144 c 145 c... Determination de jfiltnu,jfiltnv,jfiltsu,jfiltsv ....146 c.........................................................147 c 148 ! 149 ! ... Determination de jfiltnu,jfiltnv,jfiltsu,jfiltsv .... 150 ! ......................................................... 151 ! 148 152 modemax = iim 149 153 150 cccc imx = modemax - 4 * (modemax/iim)154 !ccc imx = modemax - 4 * (modemax/iim) 151 155 152 156 imx = iim 153 c 157 ! 154 158 PRINT *,' TRUNCATION AT ',imx 155 c 159 ! 156 160 DO 75 j = 2, jjm/2+1 157 161 cof = COS( rlatu(j) )/ colat0 … … 162 166 cof = COS( rlatu(jjp1-j+1) )/ colat0 163 167 IF ( cof .LT. 1. ) THEN 164 IF( rlamda(imx) * COS(rlatu(jjp1-j+1) ).LT.1. ) 165 $jfiltsu= jjp1-j+1168 IF( rlamda(imx) * COS(rlatu(jjp1-j+1) ).LT.1. ) & 169 jfiltsu= jjp1-j+1 166 170 ENDIF 167 171 75 CONTINUE 168 c 172 ! 169 173 DO 76 j = 1, jjm/2 170 174 cof = COS( rlatv(j) )/ colat0 … … 175 179 cof = COS( rlatv(jjm-j+1) )/ colat0 176 180 IF ( cof .LT. 1. ) THEN 177 IF( rlamda(imx) * COS(rlatv(jjm-j+1) ).LT.1. ) 178 $jfiltsv= jjm-j+1181 IF( rlamda(imx) * COS(rlatv(jjm-j+1) ).LT.1. ) & 182 jfiltsv= jjm-j+1 179 183 ENDIF 180 184 76 CONTINUE 181 c185 ! 182 186 183 187 IF( jfiltnu.LE.0 .OR. jfiltnu.GT. jjm/2 +1 ) THEN … … 201 205 ENDIF 202 206 203 PRINT *,' jfiltnv jfiltsv jfiltnu jfiltsu ' , 204 *jfiltnv,jfiltsv,jfiltnu,jfiltsu205 206 c207 c... Determination de coefilu,coefilv,n=modfrstu,modfrstv ....208 c................................................................209 c 210 c 207 PRINT *,' jfiltnv jfiltsv jfiltnu jfiltsu ' , & 208 jfiltnv,jfiltsv,jfiltnu,jfiltsu 209 210 ! 211 ! ... Determination de coefilu,coefilv,n=modfrstu,modfrstv .... 212 !................................................................ 213 ! 214 ! 211 215 DO 77 j = 1,jjm 212 216 modfrstu( j ) = iim 213 217 modfrstv( j ) = iim 214 218 77 CONTINUE 215 c 219 ! 216 220 DO 84 j = 2,jfiltnu 217 221 DO 81 k = 2,modemax … … 221 225 GOTO 84 222 226 82 modfrstu( j ) = k 223 c 227 ! 224 228 kf = modfrstu( j ) 225 229 DO 83 k = kf , modemax … … 229 233 83 CONTINUE 230 234 84 CONTINUE 231 c232 c 235 ! 236 ! 233 237 DO 89 j = 1,jfiltnv 234 c 238 ! 235 239 DO 86 k = 2,modemax 236 240 cof = rlamda(k) * COS( rlatv(j) ) … … 239 243 GOTO 89 240 244 87 modfrstv( j ) = k 241 c 245 ! 242 246 kf = modfrstv( j ) 243 247 DO 88 k = kf , modemax … … 246 250 coefilv2(k,j) = cof*cof - 1. 247 251 88 CONTINUE 248 c 252 ! 249 253 89 CONTINUE 250 c 254 ! 251 255 DO 94 j = jfiltsu,jjm 252 256 DO 91 k = 2,modemax … … 256 260 GOTO 94 257 261 92 modfrstu( j ) = k 258 c 262 ! 259 263 kf = modfrstu( j ) 260 264 DO 93 k = kf , modemax … … 264 268 93 CONTINUE 265 269 94 CONTINUE 266 c270 ! 267 271 DO 99 j = jfiltsv,jjm 268 272 DO 96 k = 2,modemax … … 272 276 GOTO 99 273 277 97 modfrstv( j ) = k 274 c 278 ! 275 279 kf = modfrstv( j ) 276 280 DO 98 k = kf , modemax … … 280 284 98 CONTINUE 281 285 99 CONTINUE 282 c 286 ! 283 287 284 288 IF(jfiltnv.GE.jjm/2 .OR. jfiltnu.GE.jjm/2)THEN … … 287 291 IF(jfiltnu.EQ.jfiltsu)jfiltsu=1+jfiltnu 288 292 289 PRINT *,'jfiltnv jfiltsv jfiltnu jfiltsu' , 290 *jfiltnv,jfiltsv,jfiltnu,jfiltsu293 PRINT *,'jfiltnv jfiltsv jfiltnu jfiltsu' , & 294 jfiltnv,jfiltsv,jfiltnu,jfiltsu 291 295 ENDIF 292 296 … … 298 302 299 303 IF( nfilun.LT. jfiltnu ) THEN 300 PRINT *,' le parametre nfilun utilise pour la matrice ', 301 *' matriceun est trop petit ! '304 PRINT *,' le parametre nfilun utilise pour la matrice ', & 305 ' matriceun est trop petit ! ' 302 306 PRINT *,'Le changer dans parafilt.h et le mettre a ',jfiltnu 303 PRINT *,' Pour information, nfilun,nfilus,nfilvn,nfilvs ' 304 * ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1305 *,jfiltnv,jjm-jfiltsv+1307 PRINT *,' Pour information, nfilun,nfilus,nfilvn,nfilvs ' & 308 ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1 & 309 ,jfiltnv,jjm-jfiltsv+1 306 310 STOP 307 311 ENDIF 308 312 IF( nfilun.GT. jfiltnu+ 2 ) THEN 309 PRINT *,' le parametre nfilun utilise pour la matrice ', 310 *' matriceun est trop grand ! Gachis de memoire ! '313 PRINT *,' le parametre nfilun utilise pour la matrice ', & 314 ' matriceun est trop grand ! Gachis de memoire ! ' 311 315 PRINT *,'Le changer dans parafilt.h et le mettre a ',jfiltnu 312 PRINT *,' Pour information, nfilun,nfilus,nfilvn,nfilvs ' 313 * ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1314 *,jfiltnv,jjm-jfiltsv+1315 cSTOP316 PRINT *,' Pour information, nfilun,nfilus,nfilvn,nfilvs ' & 317 ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1 & 318 ,jfiltnv,jjm-jfiltsv+1 319 ! STOP 316 320 ENDIF 317 321 IF( nfilus.LT. jjm - jfiltsu +1 ) THEN 318 PRINT *,' le parametre nfilus utilise pour la matrice ', 319 *' matriceus est trop petit ! '320 PRINT *,' Le changer dans parafilt.h et le mettre a ', 321 *jjm - jfiltsu + 1322 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' 323 * ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1324 *,jfiltnv,jjm-jfiltsv+1322 PRINT *,' le parametre nfilus utilise pour la matrice ', & 323 ' matriceus est trop petit ! ' 324 PRINT *,' Le changer dans parafilt.h et le mettre a ', & 325 jjm - jfiltsu + 1 326 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' & 327 ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1 & 328 ,jfiltnv,jjm-jfiltsv+1 325 329 STOP 326 330 ENDIF 327 331 IF( nfilus.GT. jjm - jfiltsu + 3 ) THEN 328 PRINT *,' le parametre nfilus utilise pour la matrice ', 329 *' matriceus est trop grand ! '330 PRINT *,' Le changer dans parafilt.h et le mettre a ' , 331 *jjm - jfiltsu + 1332 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' 333 * ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1334 *,jfiltnv,jjm-jfiltsv+1335 cSTOP332 PRINT *,' le parametre nfilus utilise pour la matrice ', & 333 ' matriceus est trop grand ! ' 334 PRINT *,' Le changer dans parafilt.h et le mettre a ' , & 335 jjm - jfiltsu + 1 336 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' & 337 ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1 & 338 ,jfiltnv,jjm-jfiltsv+1 339 ! STOP 336 340 ENDIF 337 341 IF( nfilvn.LT. jfiltnv ) THEN 338 PRINT *,' le parametre nfilvn utilise pour la matrice ', 339 *' matricevn est trop petit ! '342 PRINT *,' le parametre nfilvn utilise pour la matrice ', & 343 ' matricevn est trop petit ! ' 340 344 PRINT *,'Le changer dans parafilt.h et le mettre a ',jfiltnv 341 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' 342 * ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1343 *,jfiltnv,jjm-jfiltsv+1345 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' & 346 ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1 & 347 ,jfiltnv,jjm-jfiltsv+1 344 348 STOP 345 349 ENDIF 346 350 IF( nfilvn.GT. jfiltnv+ 2 ) THEN 347 PRINT *,' le parametre nfilvn utilise pour la matrice ', 348 *' matricevn est trop grand ! Gachis de memoire ! '351 PRINT *,' le parametre nfilvn utilise pour la matrice ', & 352 ' matricevn est trop grand ! Gachis de memoire ! ' 349 353 PRINT *,'Le changer dans parafilt.h et le mettre a ',jfiltnv 350 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' 351 * ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1352 *,jfiltnv,jjm-jfiltsv+1353 cSTOP354 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' & 355 ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1 & 356 ,jfiltnv,jjm-jfiltsv+1 357 ! STOP 354 358 ENDIF 355 359 IF( nfilvs.LT. jjm - jfiltsv +1 ) THEN 356 PRINT *,' le parametre nfilvs utilise pour la matrice ', 357 *' matricevs est trop petit ! Le changer dans parafilt.h '358 PRINT *,' Le changer dans parafilt.h et le mettre a ' 359 *, jjm - jfiltsv + 1360 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' 361 * ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1362 *,jfiltnv,jjm-jfiltsv+1360 PRINT *,' le parametre nfilvs utilise pour la matrice ', & 361 ' matricevs est trop petit ! Le changer dans parafilt.h ' 362 PRINT *,' Le changer dans parafilt.h et le mettre a ' & 363 , jjm - jfiltsv + 1 364 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' & 365 ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1 & 366 ,jfiltnv,jjm-jfiltsv+1 363 367 STOP 364 368 ENDIF 365 369 IF( nfilvs.GT. jjm - jfiltsv + 3 ) THEN 366 PRINT *,' le parametre nfilvs utilise pour la matrice ', 367 *' matricevs est trop grand ! Gachis de memoire ! '368 PRINT *,' Le changer dans parafilt.h et le mettre a ' 369 *, jjm - jfiltsv + 1370 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' 371 * ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1372 *,jfiltnv,jjm-jfiltsv+1373 cSTOP374 ENDIF 375 376 c377 c...................................................................378 c 379 c... Calcul de la matrice filtre 'matriceu' pour les champs situes380 csur la grille scalaire ........381 c...................................................................382 c 370 PRINT *,' le parametre nfilvs utilise pour la matrice ', & 371 ' matricevs est trop grand ! Gachis de memoire ! ' 372 PRINT *,' Le changer dans parafilt.h et le mettre a ' & 373 , jjm - jfiltsv + 1 374 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' & 375 ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1 & 376 ,jfiltnv,jjm-jfiltsv+1 377 ! STOP 378 ENDIF 379 380 ! 381 ! ................................................................... 382 ! 383 ! ... Calcul de la matrice filtre 'matriceu' pour les champs situes 384 ! sur la grille scalaire ........ 385 ! ................................................................... 386 ! 383 387 DO j = 2, jfiltnu 384 388 … … 394 398 #else 395 399 #ifdef BLAS 396 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, 397 $eignfnv, iim, eignft, iim, 0.0, matriceun(1,1,j), iim)400 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & 401 eignfnv, iim, eignft, iim, 0.0, matriceun(1,1,j), iim) 398 402 #else 399 403 DO k = 1, iim … … 401 405 matriceun(i,k,j) = 0.0 402 406 DO ii = 1, iim 403 matriceun(i,k,j) = matriceun(i,k,j) 404 .+ eignfnv(i,ii)*eignft(ii,k)407 matriceun(i,k,j) = matriceun(i,k,j) & 408 + eignfnv(i,ii)*eignft(ii,k) 405 409 ENDDO 406 410 ENDDO … … 424 428 #else 425 429 #ifdef BLAS 426 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, 427 $ eignfnv, iim, eignft, iim, 0.0,428 $matriceus(1,1,j-jfiltsu+1), iim)430 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & 431 eignfnv, iim, eignft, iim, 0.0, & 432 matriceus(1,1,j-jfiltsu+1), iim) 429 433 #else 430 434 DO k = 1, iim … … 432 436 matriceus(i,k,j-jfiltsu+1) = 0.0 433 437 DO ii = 1, iim 434 matriceus(i,k,j-jfiltsu+1) = matriceus(i,k,j-jfiltsu+1) 435 .+ eignfnv(i,ii)*eignft(ii,k)438 matriceus(i,k,j-jfiltsu+1) = matriceus(i,k,j-jfiltsu+1) & 439 + eignfnv(i,ii)*eignft(ii,k) 436 440 ENDDO 437 441 ENDDO … … 442 446 ENDDO 443 447 444 c...................................................................445 c 446 c... Calcul de la matrice filtre 'matricev' pour les champs situes447 csur la grille de V ou de Z ........448 c...................................................................449 c 448 ! ................................................................... 449 ! 450 ! ... Calcul de la matrice filtre 'matricev' pour les champs situes 451 ! sur la grille de V ou de Z ........ 452 ! ................................................................... 453 ! 450 454 DO j = 1, jfiltnv 451 455 … … 461 465 #else 462 466 #ifdef BLAS 463 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, 464 $eignfnu, iim, eignft, iim, 0.0, matricevn(1,1,j), iim)467 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & 468 eignfnu, iim, eignft, iim, 0.0, matricevn(1,1,j), iim) 465 469 #else 466 470 DO k = 1, iim … … 468 472 matricevn(i,k,j) = 0.0 469 473 DO ii = 1, iim 470 matricevn(i,k,j) = matricevn(i,k,j) 471 .+ eignfnu(i,ii)*eignft(ii,k)474 matricevn(i,k,j) = matricevn(i,k,j) & 475 + eignfnu(i,ii)*eignft(ii,k) 472 476 ENDDO 473 477 ENDDO … … 491 495 #else 492 496 #ifdef BLAS 493 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, 494 $ eignfnu, iim, eignft, iim, 0.0,495 $matricevs(1,1,j-jfiltsv+1), iim)497 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & 498 eignfnu, iim, eignft, iim, 0.0, & 499 matricevs(1,1,j-jfiltsv+1), iim) 496 500 #else 497 501 DO k = 1, iim … … 499 503 matricevs(i,k,j-jfiltsv+1) = 0.0 500 504 DO ii = 1, iim 501 matricevs(i,k,j-jfiltsv+1) = matricevs(i,k,j-jfiltsv+1) 502 .+ eignfnu(i,ii)*eignft(ii,k)505 matricevs(i,k,j-jfiltsv+1) = matricevs(i,k,j-jfiltsv+1) & 506 + eignfnu(i,ii)*eignft(ii,k) 503 507 ENDDO 504 508 ENDDO … … 509 513 ENDDO 510 514 511 c...................................................................512 c 513 c... Calcul de la matrice filtre 'matrinv' pour les champs situes514 csur la grille scalaire , pour le filtre inverse ........515 c...................................................................516 c 515 ! ................................................................... 516 ! 517 ! ... Calcul de la matrice filtre 'matrinv' pour les champs situes 518 ! sur la grille scalaire , pour le filtre inverse ........ 519 ! ................................................................... 520 ! 517 521 DO j = 2, jfiltnu 518 522 … … 528 532 #else 529 533 #ifdef BLAS 530 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, 531 $eignfnv, iim, eignft, iim, 0.0, matrinvn(1,1,j), iim)534 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & 535 eignfnv, iim, eignft, iim, 0.0, matrinvn(1,1,j), iim) 532 536 #else 533 537 DO k = 1, iim … … 535 539 matrinvn(i,k,j) = 0.0 536 540 DO ii = 1, iim 537 matrinvn(i,k,j) = matrinvn(i,k,j) 538 .+ eignfnv(i,ii)*eignft(ii,k)541 matrinvn(i,k,j) = matrinvn(i,k,j) & 542 + eignfnv(i,ii)*eignft(ii,k) 539 543 ENDDO 540 544 ENDDO … … 558 562 #else 559 563 #ifdef BLAS 560 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, 561 $eignfnv, iim, eignft, iim, 0.0, matrinvs(1,1,j-jfiltsu+1), iim)564 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & 565 eignfnv, iim, eignft, iim, 0.0, matrinvs(1,1,j-jfiltsu+1), iim) 562 566 #else 563 567 DO k = 1, iim … … 565 569 matrinvs(i,k,j-jfiltsu+1) = 0.0 566 570 DO ii = 1, iim 567 matrinvs(i,k,j-jfiltsu+1) = matrinvs(i,k,j-jfiltsu+1) 568 .+ eignfnv(i,ii)*eignft(ii,k)571 matrinvs(i,k,j-jfiltsu+1) = matrinvs(i,k,j-jfiltsu+1) & 572 + eignfnv(i,ii)*eignft(ii,k) 569 573 ENDDO 570 574 ENDDO … … 575 579 ENDDO 576 580 577 c...................................................................578 579 c 581 ! ................................................................... 582 583 ! 580 584 334 FORMAT(1x,24i3) 581 585 755 FORMAT(1x,6f10.3,i3) 582 586 583 587 RETURN 584 END 588 END SUBROUTINE inifilr 589 590 END MODULE filtreg_mod -
trunk/LMDZ.GENERIC/libf/filtrez/parafilt.h
r253 r1403 1 1 INTEGER nfilun, nfilus, nfilvn, nfilvs 2 c 3 c48 32 19 non-zoom:4 cPARAMETER (nfilun=30,nfilus=30,nfilvn=30,nfilvs=30)5 cPARAMETER (nfilun=6, nfilus=5, nfilvn=5, nfilvs=5)6 cPARAMETER (nfilun=15, nfilus=8, nfilvn=14, nfilvs=8)7 cPARAMETER (nfilun=24, nfilus=23, nfilvn=24, nfilvs=24)8 cmaf -debug PARAMETER (nfilun=2, nfilus=1, nfilvn=2, nfilvs=2)9 c 10 c 11 c96 49 11 non-zoom:12 ccc PARAMETER (nfilun=9, nfilus=8, nfilvn=8, nfilvs=8)13 c 14 c 15 c144 73 11 non-zoom:16 ccc PARAMETER (nfilun=13, nfilus=12, nfilvn=12, nfilvs=12)17 c 18 c192 143 19 non-zoom:19 cPARAMETER (nfilun=13, nfilus=12, nfilvn=13, nfilvs=13)20 cPARAMETER (nfilun=15, nfilus=14, nfilvn=14, nfilvs=14) !!NO fxyhyper21 cPARAMETER (nfilun=18, nfilus=17, nfilvn=17, nfilvs=17) !!NO fxyhyper2 ! 3 ! 48 32 19 non-zoom: 4 ! PARAMETER (nfilun=30,nfilus=30,nfilvn=30,nfilvs=30) 5 ! PARAMETER (nfilun=6, nfilus=5, nfilvn=5, nfilvs=5) 6 ! PARAMETER (nfilun=15, nfilus=8, nfilvn=14, nfilvs=8) 7 ! PARAMETER (nfilun=24, nfilus=23, nfilvn=24, nfilvs=24) 8 !maf -debug PARAMETER (nfilun=2, nfilus=1, nfilvn=2, nfilvs=2) 9 ! 10 ! 11 ! 96 49 11 non-zoom: 12 !cc PARAMETER (nfilun=9, nfilus=8, nfilvn=8, nfilvs=8) 13 ! 14 ! 15 ! 144 73 11 non-zoom: 16 !cc PARAMETER (nfilun=13, nfilus=12, nfilvn=12, nfilvs=12) 17 ! 18 ! 192 143 19 non-zoom: 19 ! PARAMETER (nfilun=13, nfilus=12, nfilvn=13, nfilvs=13) 20 ! PARAMETER (nfilun=15, nfilus=14, nfilvn=14, nfilvs=14) !!NO fxyhyper 21 ! PARAMETER (nfilun=18, nfilus=17, nfilvn=17, nfilvs=17) !!NO fxyhyper 22 22 !! PARAMETER (nfilun=9,nfilus=8,nfilvn=8,nfilvs=8) 23 ! PARAMETER (nfilun=9,nfilus=9,nfilvn=9,nfilvs=9) 23 PARAMETER (nfilun=9,nfilus=9,nfilvn=9,nfilvs=9) 24 ! 96 72 19 non-zoom: 25 !cc PARAMETER (nfilun=12, nfilus=11, nfilvn=12, nfilvs=12) 26 ! 27 ! PARAMETER ( nfilun=20, nfilus=20, nfilvn=20, nfilvs=20 ) 28 ! PARAMETER ( nfilun=8, nfilus=7, nfilvn=7, nfilvs=7 ) 29 ! 30 ! 31 ! Ici , on a exagere les nombres de lignes de latitudes a filtrer . 32 ! 33 ! La premiere fois que le Gcm rentrera dans le Filtre , 34 ! 35 ! il indiquera les bonnes valeurs de nfilun , nflius, nfilvn et 36 ! 37 ! nfilvs a mettre . Il suffira alors de changer ces valeurs dans 38 ! 39 ! Parameter ci-dessus et de relancer le run . 24 40 25 PARAMETER (nfilun=11,nfilus=11,nfilvn=11,nfilvs=11)26 ! PARAMETER (nfilun=12,nfilus=12,nfilvn=12,nfilvs=12)27 28 29 c 96 72 19 non-zoom:30 ccc PARAMETER (nfilun=12, nfilus=11, nfilvn=12, nfilvs=12)31 c32 c PARAMETER ( nfilun=20, nfilus=20, nfilvn=20, nfilvs=20 )33 c PARAMETER ( nfilun=8, nfilus=7, nfilvn=7, nfilvs=7 )34 c35 c36 c Ici , on a exagere les nombres de lignes de latitudes a filtrer .37 c38 c La premiere fois que le Gcm rentrera dans le Filtre ,39 c40 c il indiquera les bonnes valeurs de nfilun , nflius, nfilvn et41 c42 c nfilvs a mettre . Il suffira alors de changer ces valeurs dans43 c44 c Parameter ci-dessus et de relancer le run .45 -
trunk/LMDZ.GENERIC/libf/phystd/dyn1d/kcm1d.F90
r1401 r1403 8 8 use comsaison_h, only: mu0, fract, dist_star 9 9 use planete_mod 10 use callkeys_mod, only: check_cpp_match, pceil, tstrat, tracer 10 11 ! use control_mod 11 12 use comcstfi_mod -
trunk/LMDZ.GENERIC/libf/phystd/dyn1d/rcm1d.F
r1401 r1403 911 911 c necessaire a la compilation de rcm1d en 1D 912 912 913 subroutine gr_fi_dyn914 RETURN915 END913 ! subroutine gr_fi_dyn 914 ! RETURN 915 ! END 916 916 917 917 c*********************************************************************** 918 918 c*********************************************************************** 919 919 920 #include "../dyn3d/disvert.F"921 #include "../dyn3d/abort_gcm.F"922 #include "../dyn3d/diverg.F"923 #include "../dyn3d/grad.F"924 #include "../dyn3d/gr_u_scal.F"925 #include "../dyn3d/gr_v_scal.F"926 #include "../dyn3d/gr_dyn_fi.F"927 920 !#include "../dyn3d/disvert.F" 921 !#include "../dyn3d/abort_gcm.F" 922 !#include "../dyn3d/diverg.F" 923 !#include "../dyn3d/grad.F" 924 !#include "../dyn3d/gr_u_scal.F" 925 !#include "../dyn3d/gr_v_scal.F" 926 !#include "../dyn3d/gr_dyn_fi.F" 927 -
trunk/LMDZ.GENERIC/makegcm_g95
r1216 r1403 8 8 set physique=std 9 9 set phys="PHYS=$physique" 10 set include='-I$(LIBF)/grid -I$(LIBF)/ bibio -I.'10 set include='-I$(LIBF)/grid -I$(LIBF)/misc -I. -I$(LIBF)/dynlonlat_phylonlat' 11 11 set ntrac = 1 12 12 set filtre=filtrez … … 16 16 set scatterers="1" 17 17 set full="" 18 #src_dirs: directories containing source files 19 set src_dirs="grid misc" 20 18 21 ######################################################################## 19 22 # path a changer contenant les sources et les objets du modele … … 25 28 set scriptdir=`dirname $0` 26 29 setenv LMDGCM `readlink -f $scriptdir` 27 #setenv LMDGCM /u/emlmd/LMDZ.MARS30 #setenv LMDGCM "/san/home/rdword/gcm/LMDZ.GENERIC" 28 31 setenv LIBOGCM $LMDGCM/libo 29 # NetCDF 30 # 64 bit machines what is below is OK on LMD machines 31 setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_g95/lib 32 setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_g95/include 33 #else 34 # setenv NCDFLIB /distrib/local/netcdf/g95_32bits/lib 35 # setenv NCDFINC /distrib/local/netcdf/g95_32bits/include 36 #endif 37 #### 32 # NetCDF, on LMD computers: 33 setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_g95/lib 34 setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_g95/include 35 ##### 36 37 38 38 39 39 40 setenv localdir "`pwd`" … … 120 121 set machine=XNEC 121 122 set XNEC=1 123 else if ( `uname` == CYGWIN_NT-6.1-WOW64) then 124 set machine=LINUX 125 set LINUX=1 122 126 else 123 127 echo Vous travaillez sur une machine non prevue par le reglement … … 209 213 set mod_loc_dir="./" 210 214 else 211 #### set opt_link=" -C hopt -float0 -ew -P static -L$IOIPSLDIR -lsxioipsl -L /u/rech/psl/rpsl003/IOIPSL -lnetcdf_i8r8_v -I$NCDFINC -L/SX/usr/local/lib -lnetcdf_i8r8"212 215 set opt_link=" -C hopt -float0 -ew -P static -I$NCDFINC -L/SX/usr/local/lib -lnetcdf_i8r8" 213 216 set mod_loc_dir="." … … 326 329 ######################################################################## 327 330 328 case -d :331 case -d 329 332 set dim=$2 ; shift ; shift ; goto top 330 333 331 334 case -O: 332 set optim90="$2" ; s hift ; shift ; goto top335 set optim90="$2" ; set optim="$2" ; set optimtru90="$2" ; shift ; shift ; goto top 333 336 334 337 case -p … … 391 394 endif 392 395 396 393 397 echo "apres les opts dim $dim" 394 398 … … 398 402 if ( "$physique" == 'nophys' ) then 399 403 set phys="L_PHY= LIBPHY=" 400 endif 401 404 else 405 set src_dirs="$src_dirs phy$physique" 406 set include="$include "' -I$(LIBF)/phy'"$physique" 407 endif 408 set libdyn_phy="" 409 set LIBDYN_PHYS="" 402 410 ######################################################################## 403 411 #subtilites sur le nom de la librairie 404 412 ######################################################################## 413 405 414 406 415 \rm tmp ; touch tmp … … 476 485 set include="$include "'-I$(LIBF)/dyn2d ' 477 486 set dimh=$dim 478 else 487 endif 488 if ( "$dimc" == "3" ) then 479 489 if ( "$dyntype" == "olddyn" ) then 480 490 set include="$include "'-I$(LIBF)/olddyn3d ' 491 set src_dirs="$src_dirs olddyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 481 492 else 482 493 set include="$include "'-I$(LIBF)/dyn3d ' 494 set src_dirs="$src_dirs dyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 483 495 endif 496 set libdyn_phy="-ldynlonlat_phylonlat" 497 set LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a' 484 498 set dimh=`echo $dim | awk ' { print $1 "." $2 } '` 485 499 endif … … 554 568 ## NB: we still need to have L_DYN=libdyn3d to reach routines and module 555 569 ## objects which are located in dyn3d 556 set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique " 570 set dyntype="" 571 set filtre="L_DYN= DYN= FILTRE= L_FILTRE= " 572 set dyn="L_DYN= DYN= L_FILTRE= " 573 set dirmain="phy$physique/dyn1d" 574 set src_dirs="$src_dirs phy$physique/dyn1d " 575 set include="$include "' -I$(LIBF)/phy'"$physique"'/dyn1d' 557 576 endif 558 577 endif … … 576 595 if ( `expr $dimc \> 2` == 1 ) then 577 596 set filtre="FILTRE=$filtre" 597 if ( "$dyntype" == "olddyn" ) then 598 set src_dirs="$src_dirs oldfiltrez" 599 else 600 set src_dirs="$src_dirs filtrez" 601 endif 578 602 else 579 set filtre="FILTRE= L_FILTRE= "603 set filtre="FILTRE= L_FILTRE= L_DYN= " 580 604 endif 581 605 echo "MACRO FILTRE $filtre" … … 618 642 \cp tmp77 liste_des_sources_f77 619 643 \cp tmp90 liste_des_sources_f90 620 echo "On recree le makefile" 621 if ("$dyntype" == "olddyn") then 622 ./create_make_gcm olddyn3d grid bibio aeronomars phy$physique >! tmp 623 else 624 ./create_make_gcm dyn3d grid bibio aeronomars phy$physique >! tmp 625 endif 644 echo "Remaking the makefile!" 645 echo "src_dirs: $src_dirs" 646 create_make_gcm $src_dirs >! tmp 626 647 \mv tmp makefile 627 echo "N ouveau makefile cree."648 echo "New makefile created." 628 649 endif 629 650 … … 631 652 # Execution de la comande make 632 653 ######################################################################## 654 633 655 634 656 echo PHYSIQUE $phys … … 649 671 set f90=f90 650 672 else if $LINUX then 651 # set f77=pgf90652 # set f90=pgf90653 673 set f77=g95 654 674 set f90=g95 … … 727 747 set source_code=${code}.F 728 748 # handle cases when the main program is in the physics directory 729 if (-f $LMDGCM/libf/phy${physique}/${code}.F) then 730 set dyn="$dyn DIRMAIN=phy$physique " 731 endif 732 if (-f $LMDGCM/libf/phy${physique}/${code}.F90) then 749 set dirmain=dyn${dimc}d 750 if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then 733 751 set source_code=${code}.F90 734 set dyn="$dyn DIRMAIN=phy$physique " 752 endif 753 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F ) then 754 set dirmain=phy${physique}/dyn1d 755 set source_code=${code}.F 756 endif 757 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F90 ) then 758 set dirmain=phy${physique}/dyn1d 759 set source_code=${code}.F90 760 endif 761 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F ) then 762 set dirmain=dynlonlat_phylonlat/phy${physique} 763 set source_code=${code}.F 764 endif 765 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F90 ) then 766 set dirmain=dynlonlat_phylonlat/phy${physique} 767 set source_code=${code}.F90 735 768 endif 736 769 737 770 echo $make -f $LMDGCM/makefile \ 738 771 OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \ 772 OPTIM="$optim" \ 739 773 OPTIM90="$optim90" \ 740 774 OPTIMTRU90="$optimtru90" \ … … 742 776 $filtre \ 743 777 LIBO=$libo \ 744 $dyn \745 778 $phys \ 779 LIBDYN_PHYS=${LIBDYN_PHYS} \ 746 780 DIM=$dimc \ 747 781 DYNTYPE="$dyntype" \ 782 L_DYN_PHY="$libdyn_phy" \ 748 783 L_ADJNT="$adjnt" \ 749 784 LOCAL_DIR="$localdir" \ … … 756 791 MOD_SUFFIX=$mod_suffix \ 757 792 AR=$ar \ 793 DIRMAIN=$dirmain \ 758 794 SOURCE=$source_code \ 759 795 PROG=$code … … 762 798 $make -f $LMDGCM/makefile \ 763 799 OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \ 800 OPTIM="$optim" \ 764 801 OPTIM90="$optim90" \ 765 802 OPTIMTRU90="$optimtru90" \ … … 767 804 $filtre \ 768 805 LIBO=$libo \ 769 $dyn \770 806 $phys \ 807 LIBDYN_PHYS=${LIBDYN_PHYS} \ 771 808 DIM=$dimc \ 772 809 DYNTYPE="$dyntype" \ 810 L_DYN_PHY="$libdyn_phy" \ 773 811 L_ADJNT="$adjnt" \ 774 812 LOCAL_DIR="$localdir" \ … … 781 819 MOD_SUFFIX=$mod_suffix \ 782 820 AR=$ar \ 821 DIRMAIN=$dirmain \ 783 822 SOURCE=$source_code \ 784 823 PROG=$code … … 786 825 \rm -f $libf/grid/dimensions.h 787 826 \rm -f $libf/grid/bands.h 788 \rm -f $libf/phy$ {physique}/bands.h827 \rm -f $libf/phy$physique/bands.h 789 828 \rm -f $libf/phy$physique/scatterers.h -
trunk/LMDZ.GENERIC/makegcm_gfortran
r1255 r1403 8 8 set physique=std 9 9 set phys="PHYS=$physique" 10 set include='-I$(LIBF)/grid -I$(LIBF)/ bibio -I.'10 set include='-I$(LIBF)/grid -I$(LIBF)/misc -I. -I$(LIBF)/dynlonlat_phylonlat' 11 11 set ntrac = 1 12 12 set filtre=filtrez … … 16 16 set scatterers="1" 17 17 set full="" 18 #src_dirs: directories containing source files 19 set src_dirs="grid misc" 20 18 21 ######################################################################## 19 22 # path a changer contenant les sources et les objets du modele … … 405 408 if ( "$physique" == 'nophys' ) then 406 409 set phys="L_PHY= LIBPHY=" 407 endif 408 410 else 411 set src_dirs="$src_dirs phy$physique" 412 set include="$include "' -I$(LIBF)/phy'"$physique" 413 endif 414 set libdyn_phy="" 415 set LIBDYN_PHYS="" 409 416 ######################################################################## 410 417 #subtilites sur le nom de la librairie … … 484 491 set include="$include "'-I$(LIBF)/dyn2d ' 485 492 set dimh=$dim 486 else 493 endif 494 if ( "$dimc" == "3" ) then 487 495 if ( "$dyntype" == "olddyn" ) then 488 496 set include="$include "'-I$(LIBF)/olddyn3d ' 497 set src_dirs="$src_dirs olddyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 489 498 else 490 499 set include="$include "'-I$(LIBF)/dyn3d ' 500 set src_dirs="$src_dirs dyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 491 501 endif 502 set libdyn_phy="-ldynlonlat_phylonlat" 503 set LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a' 492 504 set dimh=`echo $dim | awk ' { print $1 "." $2 } '` 493 505 endif … … 562 574 ## NB: we still need to have L_DYN=libdyn3d to reach routines and module 563 575 ## objects which are located in dyn3d 564 set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique " 576 set dyntype="" 577 set filtre="L_DYN= DYN= FILTRE= L_FILTRE= " 578 set dyn="L_DYN= DYN= L_FILTRE= " 579 set dirmain="phy$physique/dyn1d" 580 set src_dirs="$src_dirs phy$physique/dyn1d " 581 set include="$include "' -I$(LIBF)/phy'"$physique"'/dyn1d' 565 582 endif 566 583 endif … … 584 601 if ( `expr $dimc \> 2` == 1 ) then 585 602 set filtre="FILTRE=$filtre" 603 if ( "$dyntype" == "olddyn" ) then 604 set src_dirs="$src_dirs oldfiltrez" 605 else 606 set src_dirs="$src_dirs filtrez" 607 endif 586 608 else 587 set filtre="FILTRE= L_FILTRE= "609 set filtre="FILTRE= L_FILTRE= L_DYN= " 588 610 endif 589 611 echo "MACRO FILTRE $filtre" … … 627 649 \cp tmp90 liste_des_sources_f90 628 650 echo "Remaking the makefile!" 629 if ("$dyntype" == "olddyn") then 630 ./create_make_gcm olddyn3d grid bibio phy$physique >! tmp 631 else 632 ./create_make_gcm dyn3d grid bibio phy$physique >! tmp 633 endif 651 echo "src_dirs: $src_dirs" 652 create_make_gcm $src_dirs >! tmp 634 653 \mv tmp makefile 635 654 echo "New makefile created." … … 744 763 set source_code=${code}.F 745 764 # handle cases when the main program is in the physics directory 746 if (-f $LMDGCM/libf/phy${physique}/${code}.F) then 747 set dyn="$dyn DIRMAIN=phy$physique " 748 endif 749 if (-f $LMDGCM/libf/phy${physique}/${code}.F90) then 765 set dirmain=dyn${dimc}d 766 if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then 750 767 set source_code=${code}.F90 751 set dyn="$dyn DIRMAIN=phy$physique " 768 endif 769 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F ) then 770 set dirmain=phy${physique}/dyn1d 771 set source_code=${code}.F 772 endif 773 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F90 ) then 774 set dirmain=phy${physique}/dyn1d 775 set source_code=${code}.F90 776 endif 777 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F ) then 778 set dirmain=dynlonlat_phylonlat/phy${physique} 779 set source_code=${code}.F 780 endif 781 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F90 ) then 782 set dirmain=dynlonlat_phylonlat/phy${physique} 783 set source_code=${code}.F90 752 784 endif 753 785 … … 760 792 $filtre \ 761 793 LIBO=$libo \ 762 $dyn \763 794 $phys \ 795 LIBDYN_PHYS=${LIBDYN_PHYS} \ 764 796 DIM=$dimc \ 765 797 DYNTYPE="$dyntype" \ 798 L_DYN_PHY="$libdyn_phy" \ 766 799 L_ADJNT="$adjnt" \ 767 800 LOCAL_DIR="$localdir" \ … … 774 807 MOD_SUFFIX=$mod_suffix \ 775 808 AR=$ar \ 809 DIRMAIN=$dirmain \ 776 810 SOURCE=$source_code \ 777 811 PROG=$code … … 786 820 $filtre \ 787 821 LIBO=$libo \ 788 $dyn \789 822 $phys \ 823 LIBDYN_PHYS=${LIBDYN_PHYS} \ 790 824 DIM=$dimc \ 791 825 DYNTYPE="$dyntype" \ 826 L_DYN_PHY="$libdyn_phy" \ 792 827 L_ADJNT="$adjnt" \ 793 828 LOCAL_DIR="$localdir" \ … … 800 835 MOD_SUFFIX=$mod_suffix \ 801 836 AR=$ar \ 837 DIRMAIN=$dirmain \ 802 838 SOURCE=$source_code \ 803 839 PROG=$code -
trunk/LMDZ.GENERIC/makegcm_ifort
r1216 r1403 8 8 set physique=std 9 9 set phys="PHYS=$physique" 10 set include='-I$(LIBF)/grid -I$(LIBF)/ bibio -I.'10 set include='-I$(LIBF)/grid -I$(LIBF)/misc -I. -I$(LIBF)/dynlonlat_phylonlat' 11 11 set ntrac = 1 12 12 set filtre=filtrez … … 16 16 set scatterers="1" 17 17 set full="" 18 #src_dirs: directories containing source files 19 set src_dirs="grid misc" 20 18 21 ######################################################################## 19 22 # path a changer contenant les sources et les objets du modele … … 126 129 set machine=XNEC 127 130 set XNEC=1 131 else if ( `uname` == CYGWIN_NT-6.1-WOW64) then 132 set machine=LINUX 133 set LINUX=1 128 134 else 129 135 echo Vous travaillez sur une machine non prevue par le reglement … … 216 222 set mod_loc_dir="./" 217 223 else 218 #### set opt_link=" -C hopt -float0 -ew -P static -L$IOIPSLDIR -lsxioipsl -L /u/rech/psl/rpsl003/IOIPSL -lnetcdf_i8r8_v -I$NCDFINC -L/SX/usr/local/lib -lnetcdf_i8r8"219 224 set opt_link=" -C hopt -float0 -ew -P static -I$NCDFINC -L/SX/usr/local/lib -lnetcdf_i8r8" 220 225 set mod_loc_dir="." … … 224 229 endif 225 230 226 set nomlib=$ machine231 set nomlib=${machine} 227 232 228 233 # Impose distinct name for 64 bit Linux machines (to avoid mixing 32 and 64) … … 404 409 if ( "$physique" == 'nophys' ) then 405 410 set phys="L_PHY= LIBPHY=" 406 endif 407 411 else 412 set src_dirs="$src_dirs phy$physique" 413 set include="$include "' -I$(LIBF)/phy'"$physique" 414 endif 415 set libdyn_phy="" 416 set LIBDYN_PHYS="" 408 417 ######################################################################## 409 418 #subtilites sur le nom de la librairie … … 483 492 set include="$include "'-I$(LIBF)/dyn2d ' 484 493 set dimh=$dim 485 else 494 endif 495 if ( "$dimc" == "3" ) then 486 496 if ( "$dyntype" == "olddyn" ) then 487 497 set include="$include "'-I$(LIBF)/olddyn3d ' 498 set src_dirs="$src_dirs olddyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 488 499 else 489 500 set include="$include "'-I$(LIBF)/dyn3d ' 501 set src_dirs="$src_dirs dyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 490 502 endif 503 set libdyn_phy="-ldynlonlat_phylonlat" 504 set LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a' 491 505 set dimh=`echo $dim | awk ' { print $1 "." $2 } '` 492 506 endif … … 561 575 ## NB: we still need to have L_DYN=libdyn3d to reach routines and module 562 576 ## objects which are located in dyn3d 563 set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique " 577 set dyntype="" 578 set filtre="L_DYN= DYN= FILTRE= L_FILTRE= " 579 set dyn="L_DYN= DYN= L_FILTRE= " 580 set dirmain="phy$physique/dyn1d" 581 set src_dirs="$src_dirs phy$physique/dyn1d " 582 set include="$include "' -I$(LIBF)/phy'"$physique"'/dyn1d' 564 583 endif 565 584 endif … … 583 602 if ( `expr $dimc \> 2` == 1 ) then 584 603 set filtre="FILTRE=$filtre" 585 else 586 set filtre="FILTRE= L_FILTRE= " 604 if ( "$dyntype" == "olddyn" ) then 605 set src_dirs="$src_dirs oldfiltrez" 606 else 607 set src_dirs="$src_dirs filtrez" 608 endif 609 else 610 set filtre="FILTRE= L_FILTRE= L_DYN= " 587 611 endif 588 612 echo "MACRO FILTRE $filtre" … … 626 650 \cp tmp90 liste_des_sources_f90 627 651 echo "Remaking the makefile!" 628 if ("$dyntype" == "olddyn") then 629 ./create_make_gcm olddyn3d grid bibio phy$physique >! tmp 630 else 631 ./create_make_gcm dyn3d grid bibio phy$physique >! tmp 632 endif 652 echo "src_dirs: $src_dirs" 653 create_make_gcm $src_dirs >! tmp 633 654 \mv tmp makefile 634 655 echo "New makefile created." … … 663 684 # set f90="ifort -real-size 64 -DNC_DOUBLE" 664 685 set opt_link=" -L$LIBOGCM -L$NCDFLIB -lnetcdf " 665 # set f77=pgf90666 # set f90=pgf90667 686 else if $SUN then 668 687 set f77=f90 … … 739 758 set source_code=${code}.F 740 759 # handle cases when the main program is in the physics directory 741 if (-f $LMDGCM/libf/phy${physique}/${code}.F) then 742 set dyn="$dyn DIRMAIN=phy$physique " 743 endif 744 if (-f $LMDGCM/libf/phy${physique}/${code}.F90) then 760 set dirmain=dyn${dimc}d 761 if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then 745 762 set source_code=${code}.F90 746 set dyn="$dyn DIRMAIN=phy$physique " 763 endif 764 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F ) then 765 set dirmain=phy${physique}/dyn1d 766 set source_code=${code}.F 767 endif 768 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F90 ) then 769 set dirmain=phy${physique}/dyn1d 770 set source_code=${code}.F90 771 endif 772 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F ) then 773 set dirmain=dynlonlat_phylonlat/phy${physique} 774 set source_code=${code}.F 775 endif 776 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F90 ) then 777 set dirmain=dynlonlat_phylonlat/phy${physique} 778 set source_code=${code}.F90 747 779 endif 748 780 … … 755 787 $filtre \ 756 788 LIBO=$libo \ 757 $dyn \758 789 $phys \ 790 LIBDYN_PHYS=${LIBDYN_PHYS} \ 759 791 DIM=$dimc \ 760 792 DYNTYPE="$dyntype" \ 793 L_DYN_PHY="$libdyn_phy" \ 761 794 L_ADJNT="$adjnt" \ 762 795 LOCAL_DIR="$localdir" \ … … 769 802 MOD_SUFFIX=$mod_suffix \ 770 803 AR=$ar \ 804 DIRMAIN=$dirmain \ 771 805 SOURCE=$source_code \ 772 806 PROG=$code 807 773 808 774 809 $make -f $LMDGCM/makefile \ … … 780 815 $filtre \ 781 816 LIBO=$libo \ 782 $dyn \783 817 $phys \ 818 LIBDYN_PHYS=${LIBDYN_PHYS} \ 784 819 DIM=$dimc \ 785 820 DYNTYPE="$dyntype" \ 821 L_DYN_PHY="$libdyn_phy" \ 786 822 L_ADJNT="$adjnt" \ 787 823 LOCAL_DIR="$localdir" \ … … 794 830 MOD_SUFFIX=$mod_suffix \ 795 831 AR=$ar \ 832 DIRMAIN=$dirmain \ 796 833 SOURCE=$source_code \ 797 834 PROG=$code … … 799 836 \rm -f $libf/grid/dimensions.h 800 837 \rm -f $libf/grid/bands.h 801 \rm -f $libf/phy$ {physique}/bands.h838 \rm -f $libf/phy$physique/bands.h 802 839 \rm -f $libf/phy$physique/scatterers.h -
trunk/LMDZ.GENERIC/makegcm_pgf90
r1216 r1403 8 8 set physique=std 9 9 set phys="PHYS=$physique" 10 set include='-I$(LIBF)/grid -I$(LIBF)/ bibio -I.'10 set include='-I$(LIBF)/grid -I$(LIBF)/misc -I. -I$(LIBF)/dynlonlat_phylonlat' 11 11 set ntrac = 1 12 12 set filtre=filtrez … … 16 16 set scatterers="1" 17 17 set full="" 18 #src_dirs: directories containing source files 19 set src_dirs="grid misc" 20 18 21 ######################################################################## 19 22 # path a changer contenant les sources et les objets du modele … … 27 30 #setenv LMDGCM "/san/home/rdword/gcm/LMDZ.GENERIC" 28 31 setenv LIBOGCM $LMDGCM/libo 29 # NetCDF, on LMD 64 bit machines32 # NetCDF, on LMD computers: 30 33 setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_pgi/lib 31 34 setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_pgi/include … … 115 118 set machine=XNEC 116 119 set XNEC=1 120 else if ( `uname` == CYGWIN_NT-6.1-WOW64) then 121 set machine=LINUX 122 set LINUX=1 117 123 else 118 124 echo Vous travaillez sur une machine non prevue par le reglement … … 208 214 set mod_loc_dir="./" 209 215 else 210 #### set opt_link=" -C hopt -float0 -ew -P static -L$IOIPSLDIR -lsxioipsl -L /u/rech/psl/rpsl003/IOIPSL -lnetcdf_i8r8_v -I$NCDFINC -L/SX/usr/local/lib -lnetcdf_i8r8"211 216 set opt_link=" -C hopt -float0 -ew -P static -I$NCDFINC -L/SX/usr/local/lib -lnetcdf_i8r8" 212 217 set mod_loc_dir="." … … 216 221 endif 217 222 218 set nomlib=$ machine223 set nomlib=${machine} 219 224 220 225 # Impose distinct name for 64 bit Linux machines (to avoid mixing 32 and 64) … … 399 404 if ( "$physique" == 'nophys' ) then 400 405 set phys="L_PHY= LIBPHY=" 401 endif 402 406 else 407 set src_dirs="$src_dirs phy$physique" 408 set include="$include "' -I$(LIBF)/phy'"$physique" 409 endif 410 set libdyn_phy="" 411 set LIBDYN_PHYS="" 403 412 ######################################################################## 404 413 #subtilites sur le nom de la librairie … … 478 487 set include="$include "'-I$(LIBF)/dyn2d ' 479 488 set dimh=$dim 480 else 489 endif 490 if ( "$dimc" == "3" ) then 481 491 if ( "$dyntype" == "olddyn" ) then 482 492 set include="$include "'-I$(LIBF)/olddyn3d ' 493 set src_dirs="$src_dirs olddyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 483 494 else 484 495 set include="$include "'-I$(LIBF)/dyn3d ' 496 set src_dirs="$src_dirs dyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 485 497 endif 498 set libdyn_phy="-ldynlonlat_phylonlat" 499 set LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a' 486 500 set dimh=`echo $dim | awk ' { print $1 "." $2 } '` 487 501 endif … … 556 570 ## NB: we still need to have L_DYN=libdyn3d to reach routines and module 557 571 ## objects which are located in dyn3d 558 set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique " 572 set dyntype="" 573 set filtre="L_DYN= DYN= FILTRE= L_FILTRE= " 574 set dyn="L_DYN= DYN= L_FILTRE= " 575 set dirmain="phy$physique/dyn1d" 576 set src_dirs="$src_dirs phy$physique/dyn1d " 577 set include="$include "' -I$(LIBF)/phy'"$physique"'/dyn1d' 559 578 endif 560 579 endif … … 578 597 if ( `expr $dimc \> 2` == 1 ) then 579 598 set filtre="FILTRE=$filtre" 599 if ( "$dyntype" == "olddyn" ) then 600 set src_dirs="$src_dirs oldfiltrez" 601 else 602 set src_dirs="$src_dirs filtrez" 603 endif 580 604 else 581 set filtre="FILTRE= L_FILTRE= "605 set filtre="FILTRE= L_FILTRE= L_DYN= " 582 606 endif 583 607 echo "MACRO FILTRE $filtre" … … 621 645 \cp tmp90 liste_des_sources_f90 622 646 echo "Remaking the makefile!" 623 if ("$dyntype" == "olddyn") then 624 ./create_make_gcm olddyn3d grid bibio phy$physique >! tmp 625 else 626 ./create_make_gcm dyn3d grid bibio phy$physique >! tmp 627 endif 647 echo "src_dirs: $src_dirs" 648 create_make_gcm $src_dirs >! tmp 628 649 \mv tmp makefile 629 650 echo "New makefile created." … … 730 751 endif 731 752 732 733 753 cd $localdir 734 754 735 755 set source_code=${code}.F 736 756 # handle cases when the main program is in the physics directory 737 if (-f $LMDGCM/libf/phy${physique}/${code}.F) then 738 set dyn="$dyn DIRMAIN=phy$physique " 739 endif 740 if (-f $LMDGCM/libf/phy${physique}/${code}.F90) then 757 set dirmain=dyn${dimc}d 758 if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then 741 759 set source_code=${code}.F90 742 set dyn="$dyn DIRMAIN=phy$physique " 760 endif 761 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F ) then 762 set dirmain=phy${physique}/dyn1d 763 set source_code=${code}.F 764 endif 765 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F90 ) then 766 set dirmain=phy${physique}/dyn1d 767 set source_code=${code}.F90 768 endif 769 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F ) then 770 set dirmain=dynlonlat_phylonlat/phy${physique} 771 set source_code=${code}.F 772 endif 773 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F90 ) then 774 set dirmain=dynlonlat_phylonlat/phy${physique} 775 set source_code=${code}.F90 743 776 endif 744 777 … … 751 784 $filtre \ 752 785 LIBO=$libo \ 753 $dyn \754 786 $phys \ 787 LIBDYN_PHYS=${LIBDYN_PHYS} \ 755 788 DIM=$dimc \ 756 789 DYNTYPE="$dyntype" \ 790 L_DYN_PHY="$libdyn_phy" \ 757 791 L_ADJNT="$adjnt" \ 758 792 LOCAL_DIR="$localdir" \ … … 765 799 MOD_SUFFIX=$mod_suffix \ 766 800 AR=$ar \ 801 DIRMAIN=$dirmain \ 767 802 SOURCE=$source_code \ 768 803 PROG=$code … … 777 812 $filtre \ 778 813 LIBO=$libo \ 779 $dyn \780 814 $phys \ 815 LIBDYN_PHYS=${LIBDYN_PHYS} \ 781 816 DIM=$dimc \ 782 817 DYNTYPE="$dyntype" \ 818 L_DYN_PHY="$libdyn_phy" \ 783 819 L_ADJNT="$adjnt" \ 784 820 LOCAL_DIR="$localdir" \ … … 791 827 MOD_SUFFIX=$mod_suffix \ 792 828 AR=$ar \ 829 DIRMAIN=$dirmain \ 793 830 SOURCE=$source_code \ 794 831 PROG=$code -
trunk/LMDZ.MARS/README
r1399 r1403 2168 2168 - Follow-up to cleanup in dynamics/physics interface. Add iniprint.h to be 2169 2169 in line with what is done in LMDZ.COMMON dynamics. 2170 2171 == 31/03/2015 == EM 2172 - Reorganizing the physics/dynamics interface, for better compatibility 2173 between models and with the parallel LMDZ.COMMON dyn core. Main structural 2174 changes are: 2175 * misc: (replaces what was the "bibio" directory) 2176 - Should only contain extremely generic (and non physics or 2177 dynamics-specific) routines 2178 * dynlonlat_phylonlat: (new interface directory) 2179 - This directory contains routines relevent to physics/dynamics grid 2180 interactions, e.g. routines gr_dyn_fi or gr_fi_dyn and calfis 2181 - Moreover the dynlonlat_phylonlat contains directory "phymars". 2182 This subdirectories should only contain specific interfaces (e.g. 2183 iniphysiq) or main programs (e.g. newstart or xvik). 2184 * phymars/dyn1d: this subdirectory contains the 1D model. -
trunk/LMDZ.MARS/create_make_gcm
r634 r1403 11 11 # ., dyn3d and grid 12 12 # 13 14 # arguments given to create_make_gcm are the directories to scan 15 src_dirs=$* 16 13 17 machine=`hostname` 14 18 os=`uname` 15 19 gcm=`pwd` 20 logfile=$gcm/create_make_gcm.log 21 rm -f $logfile ; touch -f $logfile 16 22 libf=$gcm/libf 17 23 libo=$gcm/libo … … 51 57 #echo $localdir 52 58 echo "LOCAL_DIR=`echo $localdir`" 53 echo ' BIBIO = $(LIBF)/bibio'59 echo 'MISC = $(LIBF)/misc' 54 60 echo 'AERONOMARS = $(LIBF)/aeronomars' 55 61 echo "FILTRE = filtre" … … 57 63 echo 'DYN = $(DYNTYPE)' 58 64 echo 'LIBPHY = $(LIBO)/libphy$(PHYS).a' 65 echo 'LIBDYN_PHY = $(LIBO)/libdynlmdz_phy$(PHYS).a' 59 66 echo 'DIRMAIN= $(DYN)$(DIM)d' 60 67 echo 'RM=rm' … … 64 71 echo '# Les differentes librairies pour l"edition des liens:' 65 72 echo 66 if [ "$XNEC" = '1' ] ; then 67 echo 'dyn3d = $(LIBO)/libsxdyn3d.a $(LIBO)/libsx$(FILTRE).a' 68 echo 'dyn2d = $(LIBO)/libsxdyn2d.a' 69 echo 'dyn1d = $(LIBO)/libsxdyn1d.a' 70 echo 'L_DYN = -lsxdyn$(DIM)d' 71 echo 'L_FILTRE = -lsx$(FILTRE)' 72 echo 'L_PHY = -lsxphy$(PHYS) ' 73 echo 'L_BIBIO = -lsxbibio' 74 echo 'L_AERONOMARS = -lsxaeronomars' 75 echo 'L_ADJNT =' 76 else 77 echo 'dyn3d = $(LIBO)/libdyn3d.a $(LIBO)/lib$(FILTRE).a' 78 echo 'dyn2d = $(LIBO)/libdyn2d.a' 79 echo 'dyn1d = $(LIBO)/libdyn1d.a' 80 echo 'L_DYN = -l$(DYN)$(DIM)d' 81 echo 'L_FILTRE = -l$(FILTRE)' 82 echo 'L_PHY = -lphy$(PHYS) ' 83 echo 'L_BIBIO = -lbibio' 84 echo 'L_AERONOMARS = -laeronomars' 85 echo 'L_ADJNT =' 86 fi 73 echo 'L_DYN = -ldyn$(DIM)d' 74 echo 'L_FILTRE = -l$(FILTRE)' 75 echo 'L_DYN_PHY = -ldynlmdz_phy$(PHYS) ' 76 echo 'L_PHY = -lphy$(PHYS) ' 77 echo 'L_MISC = -lmisc' 78 echo 'L_AERONOMARS = -laeronomars' 79 echo 'L_ADJNT =' 87 80 echo 88 81 echo "#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" … … 105 98 echo 106 99 echo "PROG = code" 107 echo 108 echo 'main : $(DYN) bibio phys aeronomars $(OPTION_DEP) ' 100 echo 'DYN = dyn$(DIM)d' 101 echo 102 echo 'main : $(DYN) misc phys dyn_phy aeronomars $(OPTION_DEP) ' 109 103 echo ' cd $(LIBO) ; $(RANLIB) lib*.a ; cd $(GCM) ;\' 110 104 echo ' cd $(LOCAL_DIR); \' 111 105 echo ' $(COMPILE90) $(LIBF)/$(DIRMAIN)/$(SOURCE) -o $(PROG).o ; \' 112 106 if [ "$CRAY" = '0' ] ; then 113 echo ' $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ ADJNT) $(L_FILTRE) $(L_AERONOMARS) $(L_PHY) $(L_BIBIO) $(L_DYN) $(L_AERONOMARS) $(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_FILTRE) $(L_AERONOMARS) $(L_PHY) $(L_DYN_PHY) $(L_MISC) $(L_DYN) $(L_AERONOMARS) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o ' 114 108 else 115 echo ' $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ ADJNT) $(L_FILTRE) $(L_AERONOMARS) $(L_PHY) $(L_BIBIO) $(L_DYN) $(L_AERONOMARS) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o '109 echo ' $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_DYN_PHY) $(L_ADJNT) $(L_FILTRE) $(L_AERONOMARS) $(L_PHY) $(L_DYN_PHY) $(L_MISC) $(L_DYN) $(L_AERONOMARS) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o ' 116 110 fi 117 111 echo … … 122 116 echo 'phys : $(LIBPHY)' 123 117 echo 124 echo 'bibio : $(LIBO)/libbibio.a' 118 echo 'dyn3d : $(LIBO)/libdyn3d.a $(LIBO)/lib$(FILTRE).a' 119 echo 'dyn2d : $(LIBO)/libdyn2d.a' 120 echo 'dyn1d : ' 121 echo 122 echo 'dyn_phy: $(LIBDYN_PHYS)' 123 echo 124 echo 'misc : $(LIBO)/libmisc.a' 125 125 echo 126 126 echo 'aeronomars : $(LIBO)/libaeronomars.a' … … 140 140 echo 141 141 cd $libf >/dev/null 2>&1 142 for diri in ` ls ` 143 do 142 143 for diri in $src_dirs ; do 144 144 145 if [ -d $diri ] ; then 145 if [ "`ls $diri/*.F`" != "" ] || [ "`ls $diri/*. F90`" != "" ] ; then146 cd $diri >/dev/null 2>&1146 if [ "`ls $diri/*.F`" != "" ] || [ "`ls $diri/*.[fF]90`" != "" ] ; then 147 # cd $diri >/dev/null 2>&1 147 148 echo 148 149 listlib="" 149 for i in `ls *.F` 150 do 151 fili=`basename $i .F` 150 # Liste des fichiers .F et .F90 n'etant pas des programmes principaux 151 for fili in `ls $diri/*.[fF]` ; do 152 152 # Check if file is a routine or main program 153 153 # i.e: look for the "program" keword preceeded by leading spaces 154 test=` ( head $i | grep -i '^ *program' ) ` 155 if [ "$test" = "" ] ; then 156 # if it is not a main program, add it to the list 157 listlib=$listlib" "$fili 158 fi 159 done 160 for i in `ls *.F90` 161 do 162 fili=`basename $i .F90` 154 test=` ( head $fili | grep -i '^ *program' ) ` 155 # if it is not a main program, add it to the list 156 if [ "$test" = "" ] ; then listlib=$listlib" "$fili ; fi 157 done 158 for fili in `ls $diri/*.[fF]90` ; do 163 159 # Check if file is a routine or main program 164 160 # i.e. look for "program" keyword (with possibly some leading spaces) 165 test=` ( head $ i | grep -i '^ \{0,\}program' ) `166 if [ "$test" = "" ] ; then167 # if it is not a main program, add it to the list168 listlib=$listlib" "$fili169 fi170 done171 # 172 echo173 echo174 echo "#================================================================== ====="161 test=` ( head $fili | grep -i '^ \{0,\}program' ) ` 162 # if it is not a main program, add it to the list 163 if [ "$test" = "" ] ; then listlib=$listlib" "$fili ; fi 164 done 165 echo 166 echo $listlib >> $logfile 167 echo 168 # topdiri contains main dir name (without trailing "/blabla" for subdirs) 169 topdiri=${diri%/*} 170 echo "#==================================================================" 175 171 echo "# Contenu de la bibliotheque correspondant au Directory "$diri 176 echo "#================================================================== ====="177 echo 178 for fili in $listlib179 do180 echo '$(LIBO)/lib'$ diri".a : " '$(LIBO)/lib'$diri".a("$fili".o)"172 echo "#==================================================================" 173 echo 174 for trufile in $listlib ; do 175 fili=`echo $trufile | awk -F/ ' { print $NF } ' | cut -d. -f1` 176 echo '$(LIBO)/lib'$topdiri".a : " '$(LIBO)/lib'$topdiri".a("$fili".o)" 181 177 echo 182 178 done 183 echo '.PRECIOUS : $(LIBO)/lib'$diri'.a' 184 echo 185 echo 186 echo "# Compilation des membres de la bibliotheque lib"$diri".a" 187 echo 188 for fili in $listlib 189 do 190 if [ -f $fili.F90 ] ; then 191 trufile=$fili.F90 192 else 193 trufile=$fili.F 194 fi 179 echo '.PRECIOUS : $(LIBO)/lib'$topdiri'.a' 180 echo 181 echo 182 echo "# Compilation of elements in $diri of library lib"$topdiri".a" 183 echo 184 for trufile in $listlib ; do 185 fili=`echo $trufile | awk -F/ ' { print $NF } ' | cut -d. -f1` 195 186 F90=0 ; egrep -i '^ *use ' $trufile > /dev/null 2>&1 && F90=1 196 187 egrep -i '^ *module ' $trufile > /dev/null 2>&1 && F90=1 197 188 egrep -i '#include*.inc ' $trufile > /dev/null 2>&1 && F90=1 198 str1='$(LIBO)/lib'$diri'.a('$fili'.o) : $(LIBF)/'$diri/$trufile 199 [ "$fili" = "chem.subs" ] && str1=$str1' $(LIBF)/'$diri/chem.mods.F 200 for stri in ` ( sed -n "/\#include/s/\#include//p" $trufile | sed 's/\"//g' ; egrep -i '^ *use ' $trufile | sed -e 's/,/ /' | awk ' { print $2 } ' ) ` 201 do 202 stri=`echo $stri | tr [A-Z] [a-z]` 203 if [ -f $stri ] ; then 189 str1='$(LIBO)/lib'$topdiri'.a('$fili'.o) : $(LIBF)/'$trufile 190 [ "$fili" = "$diri/chem.subs" ] && str1=$str1' $(LIBF)/'$diri/chem.mods.F 191 192 ########################################################################## 193 # TRAITEMENT DES DEPENDANCES 194 # Differents cas de dependance correspondant a des include ou des 195 # use module. 196 # soit dans le repertoire local soit dans un autre. 197 # Pour dyn3d, il faudrait remplacer la chaine de caractere par $DYN 198 # ou quelque chose du genre. 199 ########################################################################## 200 201 for stri in ` ( sed -e '/^[cC\!]/d' $trufile | sed -e "/\#include /s/\#include /XXnclude /" -e "/include /s/include /XXnclude /" -e "/INCLUDE /s/INCLUDE /XXnclude /" | sed -n "/XXnclude /s/XXnclude//p" | sed 's/\"//g' | sort | uniq ; sed -e '/^[cC\!]/d' $trufile | egrep -i '^ *use ' | sed -e 's/,/ /' | awk ' { print $2 } ' | sort | uniq ) ` ; do 202 echo $trufile $fili $stri >> $logfile 203 strj=`echo $stri | tr [A-Z] [a-z]` 204 str2="" 205 for dirinc in $src_dirs ; do 206 # Recherche dans l'ordre hierarchique inverse car seule la derniere 207 # ligne est conservee 208 # if [ $dirinc = phydev ] ; then 209 # dirstr='$(PHYS)' 210 # libstr='phy$(PHYS)' 211 # else 212 dirstr=$dirinc 213 libstr=$dirinc 214 # fi 215 echo dirinc $dirinc >> $logfile 216 if [ -f $dirinc/$stri ] ; then 217 str2='$(LIBF)/'$dirstr/$stri 218 elif [ -f $dirinc/$strj ] ; then 219 str2='$(LIBF)/'$dirstr/$stri 220 elif [ -f $dirinc/$strj.[fF]90 ] || [ -f $dirinc/$strj.[fF] ] ; then 221 strlib=`echo $libstr | awk -F/ ' { print $1 } '` 222 str2='$(LIBO)/lib'$strlib'.a('$strj'.o)' 223 elif [ -f $dirinc/$stri.[fF]90 ] || [ -f $dirinc/$stri.[fF] ] ; then 224 strlib=`echo $libstr | awk -F/ ' { print $1 } '` 225 str2='$(LIBO)/lib'$strlib'.a('$stri'.o)' 226 fi 227 echo stri $stri >> $logfile 228 echo str2 $str2 >> $logfile 229 done 230 echo dernier str2 $str2 >> $logfile 231 if [ "$str2" = "" ] ; then 232 echo Warn: Include $diri $trufile $fili $stri pas trouve >> $logfile 233 elif [ "$str2" = "$str1" ] ; then 234 echo Warn: Include $diri $trufile $fili $stri $str1 trouve 2x >> $logfile 235 else 204 236 echo $str1 \\ 205 str1='$(LIBF)/'$diri'/'$stri 206 else 207 if [ -f $stri.F ] || [ -f $stri.F90 ] ; then 208 echo $str1 \\ 209 str1='$(LIBO)/lib'$diri'.a('$stri'.o)' 210 else 211 # for dirinc in dyn3d grid bibio aeronomars phymars 212 for dirinc in $* 213 do 214 if [ -f ../$dirinc/$stri ] ; then 215 echo $str1 \\ 216 str1='$(LIBF)/'`cd .. ; ls */$stri | head -1` 217 fi 218 if [ -f ../$dirinc/$stri.F90 ] ; then 219 echo $str1 \\ 220 str1='$(LIBO)/lib'$dirinc'.a('$stri'.o)' 221 fi 222 done 223 fi 237 str1=$str2 224 238 fi 225 done 239 done # Fin de la boucle sur les dependances et ecriture de la derniere 226 240 echo $str1 227 # Compile in L OCAL_DIR directory, and before compiling,228 # remove the object from thelibrary229 echo ' cd $(L OCAL_DIR); \'230 echo ' $(AR) d $(LIBO)/lib'$ diri'.a '$fili'.o ; \'241 # Compile in LIBO directory; and before compiling, remove 242 # object from library 243 echo ' cd $(LIBO); \' 244 echo ' $(AR) d $(LIBO)/lib'$topdiri'.a '$fili'.o ; \' 231 245 if [ "$F90" -eq '0' ] ; then 232 246 ## Fixed Form Fortran 77 233 echo ' $(COMPILE) $(LIBF)/'$ diri'/'$trufile' ; \'247 echo ' $(COMPILE) $(LIBF)/'$trufile' ; \' 234 248 else 235 249 ## Fortran 90 236 if [ -f $fili.F90 ] ; then237 ## Free Form Fortran 90238 echo ' $(COMPTRU90) $(LIBF)/'$ diri'/'$trufile' ; \'250 if [ `echo $trufile | cut -d. -f2` = F90 ] ; then 251 ## Free Form 252 echo ' $(COMPTRU90) $(LIBF)/'$trufile' ; \' 239 253 else 240 ## Fixed Form Fortran 90 241 echo ' $(COMPILE90) $(LIBF)/'$diri'/'$trufile' ; \' 254 echo ' $(COMPILE90) $(LIBF)/'$trufile' ; \' 242 255 fi 243 ## If a module, handle created module descriptor file244 MODU=0; egrep -i '^ *module ' $trufile> /dev/null 2>&1 && MODU=1245 if [ "$MODU" -eq '1' -a "$CRAY" != '1' ] ; then246 if [ "$os" = 'UNIX_System_V' ] ; then247 echo ' cp $(MOD_LOC_DIR)/*.$(MOD_SUFFIX) $(LIBO)/ ; \'248 else249 echo ' mv $(MOD_LOC_DIR)/'$fili'.$(MOD_SUFFIX) $(LIBO)/'$fili'.$(MOD_SUFFIX) ; \'250 # echo ' if [ "$(MOD_LOC_DIR)" ne "$(LIBO)" ] ; then mv $(MOD_LOC_DIR)/'*'.$(MOD_SUFFIX) $(LIBO) ; fi ; \'251 fi252 fi253 256 fi 254 if ( [ "$XNEC" -eq '1' ] || [ "$X6NEC" = '1' ] || [ "$X8BRODIE" = '1' ] ) ; then255 echo ' sxar r $(LIBO)/libsx'$diri'.a '$fili'.o ; \'256 fi257 257 # Put generated object in library 258 echo ' $(AR) r $(LIBO)/lib'$diri'.a '$fili'.o ; $(RM) '$fili'.o ; \' 259 echo ' cd $(GCM)' 258 echo ' $(AR) r $(LIBO)/lib'$topdiri'.a '$fili'.o ; $(RM) '$fili'.o ; \' 260 259 echo 261 260 done -
trunk/LMDZ.MARS/libf/dyn3d/gcm.F
r1395 r1403 5 5 & nday_r, idissip, iconser, ecritstart, 6 6 & ecritphy 7 use filtreg_mod, only: inifilr 7 8 ! use comgeomphy, only: initcomgeomphy 8 9 IMPLICIT NONE … … 107 108 108 109 EXTERNAL caldyn, traceur 109 EXTERNAL dissip,geopot,iniconst ,inifilr110 EXTERNAL dissip,geopot,iniconst 110 111 EXTERNAL integrd,SCOPY 111 112 EXTERNAL inigeom -
trunk/LMDZ.MARS/libf/dyn3d/logic.h
r38 r1403 1 c-----------------------------------------------------------------------2 cINCLUDE 'logic.h'1 !----------------------------------------------------------------------- 2 ! INCLUDE 'logic.h' 3 3 4 COMMON/logic/ purmats,physic,forward,leapf,apphys,grireg, 5 *statcl,conser,apdiss,apdelq,saison,ecripar,fxyhypb,ysinus,hybrid4 COMMON/logic/ purmats,physic,forward,leapf,apphys,grireg, & 5 & statcl,conser,apdiss,apdelq,saison,ecripar,fxyhypb,ysinus,hybrid 6 6 7 LOGICAL purmats,physic,forward,leapf,apphys,grireg,statcl,conser, 8 *apdiss,apdelq,saison,ecripar,fxyhypb,ysinus,hybrid7 LOGICAL purmats,physic,forward,leapf,apphys,grireg,statcl,conser, & 8 & apdiss,apdelq,saison,ecripar,fxyhypb,ysinus,hybrid 9 9 10 c-----------------------------------------------------------------------10 !----------------------------------------------------------------------- -
trunk/LMDZ.MARS/libf/dyn3d/serre.h
r38 r1403 1 c..include serre.h2 c 3 REAL clon,clat,transx,transy,alphax,alphay,pxo,pyo, 4 ,grossismx, grossismy, dzoomx, dzoomy,taux,tauy5 COMMON/serre/clon,clat,transx,transy,alphax,alphay,pxo,pyo , 6 ,grossismx, grossismy, dzoomx, dzoomy,taux,tauy1 !..include serre.h 2 ! 3 REAL clon,clat,transx,transy,alphax,alphay,pxo,pyo, & 4 & grossismx, grossismy, dzoomx, dzoomy,taux,tauy 5 COMMON/serre/clon,clat,transx,transy,alphax,alphay,pxo,pyo , & 6 & grossismx, grossismy, dzoomx, dzoomy,taux,tauy -
trunk/LMDZ.MARS/libf/dynlonlat_phylonlat/phymars/datareadnc.F
r1401 r1403 228 228 if (k.eq.4) then 229 229 230 call multscal(imd*jmdp1,zdata,1000.,zdata)231 call multscal(imd,longitude,pi/180.,longitude)232 call multscal(jmdp1,latitude,pi/180.,latitude)230 zdata(:)=1000.*zdata(:) 231 longitude(:)=(pi/180.)*longitude(:) 232 latitude(:)=(pi/180.)*latitude(:) 233 233 234 234 call grid_noro1(360, 180, longitude, latitude, zdata, … … 299 299 c----------------------------------------------------------------------- 300 300 301 DO i=1,iimp1*jjp1 302 phisinit(i)=1000.*phisinit(i) 303 ENDDO 301 phisinit(1:iimp1*jjp1)=1000.*phisinit(1:iimp1*jjp1) 304 302 CALL dump2d(iimp1,jjp1,phisinit,'Altitude in m') 305 CALL multscal(iimp1*jjp1,phisinit,g,phisinit)303 phisinit(:)=g*phisinit(:) 306 304 307 305 c----------------------------------------------------------------------- -
trunk/LMDZ.MARS/libf/dynlonlat_phylonlat/phymars/newstart.F
r1401 r1403 34 34 use turb_mod, only: q2 35 35 use comgeomfi_h, only: ini_fillgeom 36 36 use filtreg_mod, only: inifilr 37 37 38 38 implicit none … … 137 137 integer flagthermo, flagh2o 138 138 character modif*20 139 real z_reel(iip1,jjp1)140 139 real tsud,albsud,alb_bb,ith_bb,Tiso 141 140 real ptoto,pcap,patm,airetot,ptotn,patmn … … 545 544 if (trim(modif) .eq. 'flat') then 546 545 c set topo to zero 547 CALL initial0(ip1jmp1,z_reel) 548 CALL multscal(ip1jmp1,z_reel,g,phis) 546 phis(:,:)=0 549 547 CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,phis,phisfi) 550 548 write(*,*) 'topography set to zero.' -
trunk/LMDZ.MARS/libf/dynlonlat_phylonlat/phymars/start2archive.F
r1401 r1403 24 24 use comsoil_h, only: ini_comsoil_h 25 25 use comgeomphy, only: initcomgeomphy 26 use filtreg_mod, only: inifilr 26 27 implicit none 27 28 -
trunk/LMDZ.MARS/libf/dynlonlat_phylonlat/phymars/xvik.F
r1401 r1403 1 1 PROGRAM xvik 2 3 USE filtreg_mod, ONLY: inifilr 4 2 5 IMPLICIT NONE 3 6 c======================================================================= … … 77 80 78 81 EXTERNAL iniconst,inigeom,covcont,mywrite 79 EXTERNAL inifilr,exner,pbar82 EXTERNAL exner,pbar 80 83 EXTERNAL solarlong,coordij,moy2 81 84 EXTERNAL SSUM 82 85 REAL SSUM 83 EXTERNAL lnblnk84 INTEGER lnblnk85 86 86 87 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc … … 157 158 158 159 firstcal=.true. 159 DO WHILE(l nblnk(nomfich).GT.0.AND.lnblnk(nomfich).LT.50)160 DO WHILE(len_trim(nomfich).GT.0.AND.len_trim(nomfich).LT.50) 160 161 PRINT *,'>>> nomfich : ',trim(nomfich) 161 162 162 163 c%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 163 164 164 file=pathchmp(1:l nblnk(pathchmp))//'/'//165 s nomfich(1:l nblnk(nomfich))166 PRINT*,'file.nc: ', file(1:l nblnk(file))//'.nc'165 file=pathchmp(1:len_trim(pathchmp))//'/'// 166 s nomfich(1:len_trim(nomfich)) 167 PRINT*,'file.nc: ', file(1:len_trim(file))//'.nc' 167 168 PRINT*,'timestep ',dtvr 168 169 169 170 IF(nc) THEN 170 ierr= NF_OPEN(file(1:l nblnk(file))//'.nc',NF_NOWRITE,nid)171 ierr= NF_OPEN(file(1:len_trim(file))//'.nc',NF_NOWRITE,nid) 171 172 ELSE 172 173 PRINT*,'Ouverture binaire ',file … … 179 180 c ------------------------------ 180 181 181 CALL readhead_NC(file(1:l nblnk(file))//'.nc',day0,phis,constR)182 CALL readhead_NC(file(1:len_trim(file))//'.nc',day0,phis,constR) 182 183 183 184 WRITE (*,*) 'day0 = ' , day0 -
trunk/LMDZ.MARS/libf/filtrez/coefils.h
r38 r1403 1 COMMON/coefils/jfiltnu,jfiltsu,jfiltnv,jfiltsv,sddu(iim),sddv(iim) 2 * ,unsddu(iim),unsddv(iim),coefilu(iim,jjm),coefilv(iim,jjm),3 * modfrstu(jjm),modfrstv(jjm),eignfnu(iim,iim),eignfnv(iim,iim)4 *,coefilu2(iim,jjm),coefilv2(iim,jjm)5 c1 COMMON/coefils/jfiltnu,jfiltsu,jfiltnv,jfiltsv,sddu(iim),sddv(iim)& 2 & ,unsddu(iim),unsddv(iim),coefilu(iim,jjm),coefilv(iim,jjm), & 3 & modfrstu(jjm),modfrstv(jjm),eignfnu(iim,iim),eignfnv(iim,iim) & 4 & ,coefilu2(iim,jjm),coefilv2(iim,jjm) 5 !c 6 6 INTEGER jfiltnu,jfiltsu,jfiltnv,jfiltsv,modfrstu,modfrstv 7 7 REAL sddu,sddv,unsddu,unsddv,coefilu,coefilv,eignfnu,eignfnv -
trunk/LMDZ.MARS/libf/filtrez/filtreg_mod.F90
r1401 r1403 1 MODULE filtreg_mod 2 3 CONTAINS 4 1 5 SUBROUTINE inifilr 2 c 3 c... H. Upadhyaya, O.Sharma ...4 c 6 ! 7 ! ... H. Upadhyaya, O.Sharma ... 8 ! 5 9 IMPLICIT NONE 6 c 7 cversion 3 .....8 9 cCorrection le 28/10/97 P. Le Van .10 c-------------------------------------------------------------------10 ! 11 ! version 3 ..... 12 13 ! Correction le 28/10/97 P. Le Van . 14 ! ------------------------------------------------------------------- 11 15 #include "dimensions.h" 12 16 #include "paramet.h" 13 17 #include "parafilt.h" 14 c-------------------------------------------------------------------18 ! ------------------------------------------------------------------- 15 19 #include "comgeom.h" 16 20 #include "coefils.h" … … 20 24 REAL dlonu(iim),dlatu(jjm) 21 25 REAL rlamda( iim ), eignvl( iim ) 22 c 26 ! 23 27 24 28 REAL lamdamax,pi,cof … … 26 30 REAL dymin,dxmin,colat0 27 31 REAL eignft(iim,iim), coff 28 REAL matriceun,matriceus,matricevn,matricevs,matrinvn,matrinvs 29 COMMON/matrfil/matriceun(iim,iim,nfilun),matriceus(iim,iim,nfilus) 30 , , matricevn(iim,iim,nfilvn),matricevs(iim,iim,nfilvs)31 ,, matrinvn(iim,iim,nfilun),matrinvs (iim,iim,nfilus)32 REAL matriceun,matriceus,matricevn,matricevs,matrinvn,matrinvs 33 COMMON/matrfil/matriceun(iim,iim,nfilun),matriceus(iim,iim,nfilus) & 34 , matricevn(iim,iim,nfilvn),matricevs(iim,iim,nfilvs) & 35 , matrinvn(iim,iim,nfilun),matrinvs (iim,iim,nfilus) 32 36 #ifdef CRAY 33 37 INTEGER ISMIN … … 37 41 #endif 38 42 EXTERNAL inifgn 39 c 40 c------------------------------------------------------------41 cThis routine computes the eigenfunctions of the laplacien42 con the stretched grid, and the filtering coefficients43 c44 cWe designate:45 ceignfn eigenfunctions of the discrete laplacien46 ceigenvl eigenvalues47 cjfiltn indexof the last scalar line filtered in NH48 cjfilts index of the first line filtered in SH49 cmodfrst index of the mode from where modes are filtered50 cmodemax maximum number of modes ( im )51 ccoefil filtering coefficients ( lamda_max*cos(rlat)/lamda )52 csdd SQRT( dx )53 c54 cthe modes are filtered from modfrst to modemax55 c56 c-----------------------------------------------------------57 c 43 ! 44 ! ------------------------------------------------------------ 45 ! This routine computes the eigenfunctions of the laplacien 46 ! on the stretched grid, and the filtering coefficients 47 ! 48 ! We designate: 49 ! eignfn eigenfunctions of the discrete laplacien 50 ! eigenvl eigenvalues 51 ! jfiltn indexof the last scalar line filtered in NH 52 ! jfilts index of the first line filtered in SH 53 ! modfrst index of the mode from where modes are filtered 54 ! modemax maximum number of modes ( im ) 55 ! coefil filtering coefficients ( lamda_max*cos(rlat)/lamda ) 56 ! sdd SQRT( dx ) 57 ! 58 ! the modes are filtered from modfrst to modemax 59 60 !----------------------------------------------------------- 61 ! 58 62 59 63 pi = 2. * ASIN( 1. ) … … 62 66 dlonu(i) = xprimu( i ) 63 67 ENDDO 64 c 68 ! 65 69 CALL inifgn(eignvl) 66 c 70 ! 67 71 print *,' EIGNVL ' 68 72 PRINT 250,eignvl 69 73 250 FORMAT( 1x,5e13.6) 70 c 71 ccompute eigenvalues and eigenfunctions72 c 73 c 74 c.................................................................75 c 76 ccompute the filtering coefficients for scalar lines and77 cmeridional wind v-lines78 c 79 cwe filter all those latitude lines where coefil < 180 cNO FILTERING AT POLES81 c 82 ccolat0 is to be used when alpha (stretching coefficient)83 cis set equal to zero for the regular grid case84 c 85 c....... Calcul de colat0 .........86 c..... colat0 = minimum de ( 0.5, min dy/ min dx ) ...87 c 88 c 74 ! 75 ! compute eigenvalues and eigenfunctions 76 ! 77 ! 78 !................................................................. 79 ! 80 ! compute the filtering coefficients for scalar lines and 81 ! meridional wind v-lines 82 ! 83 ! we filter all those latitude lines where coefil < 1 84 ! NO FILTERING AT POLES 85 ! 86 ! colat0 is to be used when alpha (stretching coefficient) 87 ! is set equal to zero for the regular grid case 88 ! 89 ! ....... Calcul de colat0 ......... 90 ! ..... colat0 = minimum de ( 0.5, min dy/ min dx ) ... 91 ! 92 ! 89 93 DO 45 j = 1,jjm 90 94 dlatu( j ) = rlatu( j ) - rlatu( j+1 ) 91 95 45 CONTINUE 92 c 96 ! 93 97 #ifdef CRAY 94 98 iymin = ISMIN( jjm, dlatu, 1 ) … … 106 110 ENDDO 107 111 #endif 108 c 109 c 112 ! 113 ! 110 114 colat0 = MIN( 0.5, dymin/dxmin ) 111 c 115 ! 112 116 IF( .NOT.fxyhypb.AND.ysinus ) THEN 113 117 colat0 = 0.6 114 c...... a revoir pour ysinus ! .......118 ! ...... a revoir pour ysinus ! ....... 115 119 alphax = 0. 116 120 ENDIF 117 c 121 ! 118 122 PRINT 50, colat0,alphax 119 123 50 FORMAT(/15x,' Inifilr colat0 alphax ',2e16.7) 120 c 124 ! 121 125 IF(alphax.EQ.1. ) THEN 122 126 PRINT *,' Inifilr alphax doit etre < a 1. Corriger ' 123 127 STOP 124 128 ENDIF 125 c 129 ! 126 130 lamdamax = iim / ( pi * colat0 * ( 1. - alphax ) ) 127 131 128 cc ... Correction le 28/10/97 ( P.Le Van ) ..129 c 132 !c ... Correction le 28/10/97 ( P.Le Van ) .. 133 ! 130 134 DO 71 i = 2,iim 131 135 rlamda( i ) = lamdamax/ SQRT( ABS( eignvl(i) ) ) 132 136 71 CONTINUE 133 c 137 ! 134 138 135 139 DO 72 j = 1,jjm … … 142 146 72 CONTINUE 143 147 144 c 145 c... Determination de jfiltnu,jfiltnv,jfiltsu,jfiltsv ....146 c.........................................................147 c 148 ! 149 ! ... Determination de jfiltnu,jfiltnv,jfiltsu,jfiltsv .... 150 ! ......................................................... 151 ! 148 152 modemax = iim 149 153 150 cccc imx = modemax - 4 * (modemax/iim)154 !ccc imx = modemax - 4 * (modemax/iim) 151 155 152 156 imx = iim 153 c 157 ! 154 158 PRINT *,' TRUNCATION AT ',imx 155 c 159 ! 156 160 DO 75 j = 2, jjm/2+1 157 161 cof = COS( rlatu(j) )/ colat0 … … 162 166 cof = COS( rlatu(jjp1-j+1) )/ colat0 163 167 IF ( cof .LT. 1. ) THEN 164 IF( rlamda(imx) * COS(rlatu(jjp1-j+1) ).LT.1. ) 165 $jfiltsu= jjp1-j+1168 IF( rlamda(imx) * COS(rlatu(jjp1-j+1) ).LT.1. ) & 169 jfiltsu= jjp1-j+1 166 170 ENDIF 167 171 75 CONTINUE 168 c 172 ! 169 173 DO 76 j = 1, jjm/2 170 174 cof = COS( rlatv(j) )/ colat0 … … 175 179 cof = COS( rlatv(jjm-j+1) )/ colat0 176 180 IF ( cof .LT. 1. ) THEN 177 IF( rlamda(imx) * COS(rlatv(jjm-j+1) ).LT.1. ) 178 $jfiltsv= jjm-j+1181 IF( rlamda(imx) * COS(rlatv(jjm-j+1) ).LT.1. ) & 182 jfiltsv= jjm-j+1 179 183 ENDIF 180 184 76 CONTINUE 181 c185 ! 182 186 183 187 IF( jfiltnu.LE.0 .OR. jfiltnu.GT. jjm/2 +1 ) THEN … … 201 205 ENDIF 202 206 203 PRINT *,' jfiltnv jfiltsv jfiltnu jfiltsu ' , 204 *jfiltnv,jfiltsv,jfiltnu,jfiltsu205 206 c207 c... Determination de coefilu,coefilv,n=modfrstu,modfrstv ....208 c................................................................209 c 210 c 207 PRINT *,' jfiltnv jfiltsv jfiltnu jfiltsu ' , & 208 jfiltnv,jfiltsv,jfiltnu,jfiltsu 209 210 ! 211 ! ... Determination de coefilu,coefilv,n=modfrstu,modfrstv .... 212 !................................................................ 213 ! 214 ! 211 215 DO 77 j = 1,jjm 212 216 modfrstu( j ) = iim 213 217 modfrstv( j ) = iim 214 218 77 CONTINUE 215 c 219 ! 216 220 DO 84 j = 2,jfiltnu 217 221 DO 81 k = 2,modemax … … 221 225 GOTO 84 222 226 82 modfrstu( j ) = k 223 c 227 ! 224 228 kf = modfrstu( j ) 225 229 DO 83 k = kf , modemax … … 229 233 83 CONTINUE 230 234 84 CONTINUE 231 c232 c 235 ! 236 ! 233 237 DO 89 j = 1,jfiltnv 234 c 238 ! 235 239 DO 86 k = 2,modemax 236 240 cof = rlamda(k) * COS( rlatv(j) ) … … 239 243 GOTO 89 240 244 87 modfrstv( j ) = k 241 c 245 ! 242 246 kf = modfrstv( j ) 243 247 DO 88 k = kf , modemax … … 246 250 coefilv2(k,j) = cof*cof - 1. 247 251 88 CONTINUE 248 c 252 ! 249 253 89 CONTINUE 250 c 254 ! 251 255 DO 94 j = jfiltsu,jjm 252 256 DO 91 k = 2,modemax … … 256 260 GOTO 94 257 261 92 modfrstu( j ) = k 258 c 262 ! 259 263 kf = modfrstu( j ) 260 264 DO 93 k = kf , modemax … … 264 268 93 CONTINUE 265 269 94 CONTINUE 266 c270 ! 267 271 DO 99 j = jfiltsv,jjm 268 272 DO 96 k = 2,modemax … … 272 276 GOTO 99 273 277 97 modfrstv( j ) = k 274 c 278 ! 275 279 kf = modfrstv( j ) 276 280 DO 98 k = kf , modemax … … 280 284 98 CONTINUE 281 285 99 CONTINUE 282 c 286 ! 283 287 284 288 IF(jfiltnv.GE.jjm/2 .OR. jfiltnu.GE.jjm/2)THEN … … 287 291 IF(jfiltnu.EQ.jfiltsu)jfiltsu=1+jfiltnu 288 292 289 PRINT *,'jfiltnv jfiltsv jfiltnu jfiltsu' , 290 *jfiltnv,jfiltsv,jfiltnu,jfiltsu293 PRINT *,'jfiltnv jfiltsv jfiltnu jfiltsu' , & 294 jfiltnv,jfiltsv,jfiltnu,jfiltsu 291 295 ENDIF 292 296 … … 298 302 299 303 IF( nfilun.LT. jfiltnu ) THEN 300 PRINT *,' le parametre nfilun utilise pour la matrice ', 301 *' matriceun est trop petit ! '304 PRINT *,' le parametre nfilun utilise pour la matrice ', & 305 ' matriceun est trop petit ! ' 302 306 PRINT *,'Le changer dans parafilt.h et le mettre a ',jfiltnu 303 PRINT *,' Pour information, nfilun,nfilus,nfilvn,nfilvs ' 304 * ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1305 *,jfiltnv,jjm-jfiltsv+1307 PRINT *,' Pour information, nfilun,nfilus,nfilvn,nfilvs ' & 308 ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1 & 309 ,jfiltnv,jjm-jfiltsv+1 306 310 STOP 307 311 ENDIF 308 312 IF( nfilun.GT. jfiltnu+ 2 ) THEN 309 PRINT *,' le parametre nfilun utilise pour la matrice ', 310 *' matriceun est trop grand ! Gachis de memoire ! '313 PRINT *,' le parametre nfilun utilise pour la matrice ', & 314 ' matriceun est trop grand ! Gachis de memoire ! ' 311 315 PRINT *,'Le changer dans parafilt.h et le mettre a ',jfiltnu 312 PRINT *,' Pour information, nfilun,nfilus,nfilvn,nfilvs ' 313 * ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1314 *,jfiltnv,jjm-jfiltsv+1315 cSTOP316 PRINT *,' Pour information, nfilun,nfilus,nfilvn,nfilvs ' & 317 ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1 & 318 ,jfiltnv,jjm-jfiltsv+1 319 ! STOP 316 320 ENDIF 317 321 IF( nfilus.LT. jjm - jfiltsu +1 ) THEN 318 PRINT *,' le parametre nfilus utilise pour la matrice ', 319 *' matriceus est trop petit ! '320 PRINT *,' Le changer dans parafilt.h et le mettre a ', 321 *jjm - jfiltsu + 1322 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' 323 * ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1324 *,jfiltnv,jjm-jfiltsv+1322 PRINT *,' le parametre nfilus utilise pour la matrice ', & 323 ' matriceus est trop petit ! ' 324 PRINT *,' Le changer dans parafilt.h et le mettre a ', & 325 jjm - jfiltsu + 1 326 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' & 327 ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1 & 328 ,jfiltnv,jjm-jfiltsv+1 325 329 STOP 326 330 ENDIF 327 331 IF( nfilus.GT. jjm - jfiltsu + 3 ) THEN 328 PRINT *,' le parametre nfilus utilise pour la matrice ', 329 *' matriceus est trop grand ! '330 PRINT *,' Le changer dans parafilt.h et le mettre a ' , 331 *jjm - jfiltsu + 1332 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' 333 * ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1334 *,jfiltnv,jjm-jfiltsv+1335 cSTOP332 PRINT *,' le parametre nfilus utilise pour la matrice ', & 333 ' matriceus est trop grand ! ' 334 PRINT *,' Le changer dans parafilt.h et le mettre a ' , & 335 jjm - jfiltsu + 1 336 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' & 337 ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1 & 338 ,jfiltnv,jjm-jfiltsv+1 339 ! STOP 336 340 ENDIF 337 341 IF( nfilvn.LT. jfiltnv ) THEN 338 PRINT *,' le parametre nfilvn utilise pour la matrice ', 339 *' matricevn est trop petit ! '342 PRINT *,' le parametre nfilvn utilise pour la matrice ', & 343 ' matricevn est trop petit ! ' 340 344 PRINT *,'Le changer dans parafilt.h et le mettre a ',jfiltnv 341 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' 342 * ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1343 *,jfiltnv,jjm-jfiltsv+1345 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' & 346 ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1 & 347 ,jfiltnv,jjm-jfiltsv+1 344 348 STOP 345 349 ENDIF 346 350 IF( nfilvn.GT. jfiltnv+ 2 ) THEN 347 PRINT *,' le parametre nfilvn utilise pour la matrice ', 348 *' matricevn est trop grand ! Gachis de memoire ! '351 PRINT *,' le parametre nfilvn utilise pour la matrice ', & 352 ' matricevn est trop grand ! Gachis de memoire ! ' 349 353 PRINT *,'Le changer dans parafilt.h et le mettre a ',jfiltnv 350 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' 351 * ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1352 *,jfiltnv,jjm-jfiltsv+1353 cSTOP354 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' & 355 ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1 & 356 ,jfiltnv,jjm-jfiltsv+1 357 ! STOP 354 358 ENDIF 355 359 IF( nfilvs.LT. jjm - jfiltsv +1 ) THEN 356 PRINT *,' le parametre nfilvs utilise pour la matrice ', 357 *' matricevs est trop petit ! Le changer dans parafilt.h '358 PRINT *,' Le changer dans parafilt.h et le mettre a ' 359 *, jjm - jfiltsv + 1360 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' 361 * ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1362 *,jfiltnv,jjm-jfiltsv+1360 PRINT *,' le parametre nfilvs utilise pour la matrice ', & 361 ' matricevs est trop petit ! Le changer dans parafilt.h ' 362 PRINT *,' Le changer dans parafilt.h et le mettre a ' & 363 , jjm - jfiltsv + 1 364 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' & 365 ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1 & 366 ,jfiltnv,jjm-jfiltsv+1 363 367 STOP 364 368 ENDIF 365 369 IF( nfilvs.GT. jjm - jfiltsv + 3 ) THEN 366 PRINT *,' le parametre nfilvs utilise pour la matrice ', 367 *' matricevs est trop grand ! Gachis de memoire ! '368 PRINT *,' Le changer dans parafilt.h et le mettre a ' 369 *, jjm - jfiltsv + 1370 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' 371 * ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1372 *,jfiltnv,jjm-jfiltsv+1373 cSTOP374 ENDIF 375 376 c377 c...................................................................378 c 379 c... Calcul de la matrice filtre 'matriceu' pour les champs situes380 csur la grille scalaire ........381 c...................................................................382 c 370 PRINT *,' le parametre nfilvs utilise pour la matrice ', & 371 ' matricevs est trop grand ! Gachis de memoire ! ' 372 PRINT *,' Le changer dans parafilt.h et le mettre a ' & 373 , jjm - jfiltsv + 1 374 PRINT *,' Pour information , nfilun,nfilus,nfilvn,nfilvs ' & 375 ,'doivent etre egaux successivement a ',jfiltnu,jjm-jfiltsu+1 & 376 ,jfiltnv,jjm-jfiltsv+1 377 ! STOP 378 ENDIF 379 380 ! 381 ! ................................................................... 382 ! 383 ! ... Calcul de la matrice filtre 'matriceu' pour les champs situes 384 ! sur la grille scalaire ........ 385 ! ................................................................... 386 ! 383 387 DO j = 2, jfiltnu 384 388 … … 394 398 #else 395 399 #ifdef BLAS 396 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, 397 $eignfnv, iim, eignft, iim, 0.0, matriceun(1,1,j), iim)400 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & 401 eignfnv, iim, eignft, iim, 0.0, matriceun(1,1,j), iim) 398 402 #else 399 403 DO k = 1, iim … … 401 405 matriceun(i,k,j) = 0.0 402 406 DO ii = 1, iim 403 matriceun(i,k,j) = matriceun(i,k,j) 404 .+ eignfnv(i,ii)*eignft(ii,k)407 matriceun(i,k,j) = matriceun(i,k,j) & 408 + eignfnv(i,ii)*eignft(ii,k) 405 409 ENDDO 406 410 ENDDO … … 424 428 #else 425 429 #ifdef BLAS 426 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, 427 $ eignfnv, iim, eignft, iim, 0.0,428 $matriceus(1,1,j-jfiltsu+1), iim)430 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & 431 eignfnv, iim, eignft, iim, 0.0, & 432 matriceus(1,1,j-jfiltsu+1), iim) 429 433 #else 430 434 DO k = 1, iim … … 432 436 matriceus(i,k,j-jfiltsu+1) = 0.0 433 437 DO ii = 1, iim 434 matriceus(i,k,j-jfiltsu+1) = matriceus(i,k,j-jfiltsu+1) 435 .+ eignfnv(i,ii)*eignft(ii,k)438 matriceus(i,k,j-jfiltsu+1) = matriceus(i,k,j-jfiltsu+1) & 439 + eignfnv(i,ii)*eignft(ii,k) 436 440 ENDDO 437 441 ENDDO … … 442 446 ENDDO 443 447 444 c...................................................................445 c 446 c... Calcul de la matrice filtre 'matricev' pour les champs situes447 csur la grille de V ou de Z ........448 c...................................................................449 c 448 ! ................................................................... 449 ! 450 ! ... Calcul de la matrice filtre 'matricev' pour les champs situes 451 ! sur la grille de V ou de Z ........ 452 ! ................................................................... 453 ! 450 454 DO j = 1, jfiltnv 451 455 … … 461 465 #else 462 466 #ifdef BLAS 463 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, 464 $eignfnu, iim, eignft, iim, 0.0, matricevn(1,1,j), iim)467 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & 468 eignfnu, iim, eignft, iim, 0.0, matricevn(1,1,j), iim) 465 469 #else 466 470 DO k = 1, iim … … 468 472 matricevn(i,k,j) = 0.0 469 473 DO ii = 1, iim 470 matricevn(i,k,j) = matricevn(i,k,j) 471 .+ eignfnu(i,ii)*eignft(ii,k)474 matricevn(i,k,j) = matricevn(i,k,j) & 475 + eignfnu(i,ii)*eignft(ii,k) 472 476 ENDDO 473 477 ENDDO … … 491 495 #else 492 496 #ifdef BLAS 493 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, 494 $ eignfnu, iim, eignft, iim, 0.0,495 $matricevs(1,1,j-jfiltsv+1), iim)497 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & 498 eignfnu, iim, eignft, iim, 0.0, & 499 matricevs(1,1,j-jfiltsv+1), iim) 496 500 #else 497 501 DO k = 1, iim … … 499 503 matricevs(i,k,j-jfiltsv+1) = 0.0 500 504 DO ii = 1, iim 501 matricevs(i,k,j-jfiltsv+1) = matricevs(i,k,j-jfiltsv+1) 502 .+ eignfnu(i,ii)*eignft(ii,k)505 matricevs(i,k,j-jfiltsv+1) = matricevs(i,k,j-jfiltsv+1) & 506 + eignfnu(i,ii)*eignft(ii,k) 503 507 ENDDO 504 508 ENDDO … … 509 513 ENDDO 510 514 511 c...................................................................512 c 513 c... Calcul de la matrice filtre 'matrinv' pour les champs situes514 csur la grille scalaire , pour le filtre inverse ........515 c...................................................................516 c 515 ! ................................................................... 516 ! 517 ! ... Calcul de la matrice filtre 'matrinv' pour les champs situes 518 ! sur la grille scalaire , pour le filtre inverse ........ 519 ! ................................................................... 520 ! 517 521 DO j = 2, jfiltnu 518 522 … … 528 532 #else 529 533 #ifdef BLAS 530 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, 531 $eignfnv, iim, eignft, iim, 0.0, matrinvn(1,1,j), iim)534 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & 535 eignfnv, iim, eignft, iim, 0.0, matrinvn(1,1,j), iim) 532 536 #else 533 537 DO k = 1, iim … … 535 539 matrinvn(i,k,j) = 0.0 536 540 DO ii = 1, iim 537 matrinvn(i,k,j) = matrinvn(i,k,j) 538 .+ eignfnv(i,ii)*eignft(ii,k)541 matrinvn(i,k,j) = matrinvn(i,k,j) & 542 + eignfnv(i,ii)*eignft(ii,k) 539 543 ENDDO 540 544 ENDDO … … 558 562 #else 559 563 #ifdef BLAS 560 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, 561 $eignfnv, iim, eignft, iim, 0.0, matrinvs(1,1,j-jfiltsu+1), iim)564 CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & 565 eignfnv, iim, eignft, iim, 0.0, matrinvs(1,1,j-jfiltsu+1), iim) 562 566 #else 563 567 DO k = 1, iim … … 565 569 matrinvs(i,k,j-jfiltsu+1) = 0.0 566 570 DO ii = 1, iim 567 matrinvs(i,k,j-jfiltsu+1) = matrinvs(i,k,j-jfiltsu+1) 568 .+ eignfnv(i,ii)*eignft(ii,k)571 matrinvs(i,k,j-jfiltsu+1) = matrinvs(i,k,j-jfiltsu+1) & 572 + eignfnv(i,ii)*eignft(ii,k) 569 573 ENDDO 570 574 ENDDO … … 575 579 ENDDO 576 580 577 c...................................................................578 579 c 581 ! ................................................................... 582 583 ! 580 584 334 FORMAT(1x,24i3) 581 585 755 FORMAT(1x,6f10.3,i3) 582 586 583 587 RETURN 584 END 588 END SUBROUTINE inifilr 589 590 END MODULE filtreg_mod -
trunk/LMDZ.MARS/libf/filtrez/parafilt.h
r38 r1403 1 1 INTEGER nfilun, nfilus, nfilvn, nfilvs 2 c 3 c48 32 19 non-zoom:4 cPARAMETER (nfilun=30,nfilus=30,nfilvn=30,nfilvs=30)5 cPARAMETER (nfilun=6, nfilus=5, nfilvn=5, nfilvs=5)6 cPARAMETER (nfilun=15, nfilus=8, nfilvn=14, nfilvs=8)7 cPARAMETER (nfilun=24, nfilus=23, nfilvn=24, nfilvs=24)8 cmaf -debug PARAMETER (nfilun=2, nfilus=1, nfilvn=2, nfilvs=2)9 c 10 c 11 c96 49 11 non-zoom:12 ccc PARAMETER (nfilun=9, nfilus=8, nfilvn=8, nfilvs=8)13 c 14 c 15 c144 73 11 non-zoom:16 ccc PARAMETER (nfilun=13, nfilus=12, nfilvn=12, nfilvs=12)17 c 18 c192 143 19 non-zoom:19 cPARAMETER (nfilun=13, nfilus=12, nfilvn=13, nfilvs=13)20 cPARAMETER (nfilun=15, nfilus=14, nfilvn=14, nfilvs=14) !!NO fxyhyper21 cPARAMETER (nfilun=18, nfilus=17, nfilvn=17, nfilvs=17) !!NO fxyhyper2 ! 3 ! 48 32 19 non-zoom: 4 ! PARAMETER (nfilun=30,nfilus=30,nfilvn=30,nfilvs=30) 5 ! PARAMETER (nfilun=6, nfilus=5, nfilvn=5, nfilvs=5) 6 ! PARAMETER (nfilun=15, nfilus=8, nfilvn=14, nfilvs=8) 7 ! PARAMETER (nfilun=24, nfilus=23, nfilvn=24, nfilvs=24) 8 !maf -debug PARAMETER (nfilun=2, nfilus=1, nfilvn=2, nfilvs=2) 9 ! 10 ! 11 ! 96 49 11 non-zoom: 12 !cc PARAMETER (nfilun=9, nfilus=8, nfilvn=8, nfilvs=8) 13 ! 14 ! 15 ! 144 73 11 non-zoom: 16 !cc PARAMETER (nfilun=13, nfilus=12, nfilvn=12, nfilvs=12) 17 ! 18 ! 192 143 19 non-zoom: 19 ! PARAMETER (nfilun=13, nfilus=12, nfilvn=13, nfilvs=13) 20 ! PARAMETER (nfilun=15, nfilus=14, nfilvn=14, nfilvs=14) !!NO fxyhyper 21 ! PARAMETER (nfilun=18, nfilus=17, nfilvn=17, nfilvs=17) !!NO fxyhyper 22 22 !! PARAMETER (nfilun=9,nfilus=8,nfilvn=8,nfilvs=8) 23 23 PARAMETER (nfilun=9,nfilus=9,nfilvn=9,nfilvs=9) 24 c96 72 19 non-zoom:25 ccc PARAMETER (nfilun=12, nfilus=11, nfilvn=12, nfilvs=12)26 c 27 cPARAMETER ( nfilun=20, nfilus=20, nfilvn=20, nfilvs=20 )28 cPARAMETER ( nfilun=8, nfilus=7, nfilvn=7, nfilvs=7 )29 c 30 c 31 cIci , on a exagere les nombres de lignes de latitudes a filtrer .32 c 33 cLa premiere fois que le Gcm rentrera dans le Filtre ,34 c 35 cil indiquera les bonnes valeurs de nfilun , nflius, nfilvn et36 c 37 cnfilvs a mettre . Il suffira alors de changer ces valeurs dans38 c 39 cParameter ci-dessus et de relancer le run .24 ! 96 72 19 non-zoom: 25 !cc PARAMETER (nfilun=12, nfilus=11, nfilvn=12, nfilvs=12) 26 ! 27 ! PARAMETER ( nfilun=20, nfilus=20, nfilvn=20, nfilvs=20 ) 28 ! PARAMETER ( nfilun=8, nfilus=7, nfilvn=7, nfilvs=7 ) 29 ! 30 ! 31 ! Ici , on a exagere les nombres de lignes de latitudes a filtrer . 32 ! 33 ! La premiere fois que le Gcm rentrera dans le Filtre , 34 ! 35 ! il indiquera les bonnes valeurs de nfilun , nflius, nfilvn et 36 ! 37 ! nfilvs a mettre . Il suffira alors de changer ces valeurs dans 38 ! 39 ! Parameter ci-dessus et de relancer le run . 40 40 -
trunk/LMDZ.MARS/makegcm_g95
r1246 r1403 8 8 set physique=mars 9 9 set phys="PHYS=$physique" 10 set include='-I$(LIBF)/grid -I$(LIBF)/ bibio -I. -I$(LIBF)/aeronomars'10 set include='-I$(LIBF)/grid -I$(LIBF)/misc -I. -I$(LIBF)/dynlonlat_phylonlat' 11 11 set ntrac = 1 12 12 set filtre=filtrez … … 14 14 set dyntype="dyn" 15 15 set full="" 16 #src_dirs: directories containing source files 17 set src_dirs="grid misc" 18 16 19 ######################################################################## 17 20 # path a changer contenant les sources et les objets du modele 18 21 ######################################################################## 19 22 20 #### #If you want you can set environment variables here (instead of21 #### #relying on the C-shell environment variables)22 # #default LMDGCM to where makegcm script is located:23 #set scriptdir=`dirname $0`24 #setenv LMDGCM `readlink -f $scriptdir`25 # #You may set LIBOGCM to something else; otherwise we default to:26 #setenv LIBOGCM $LMDGCM/libo27 ## #NetCDF Libraries: what follows is OK for LMD 32 and 64bit Linux Machines28 # #if ( `uname -m` == "x86_64" ) then29 # ##64 bit machines30 #setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_g95/lib31 #setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_g95/include32 # #else33 # #setenv NCDFLIB /donnees/emlmd/netcdf-4.0.1_g95/lib34 # #setenv NCDFINC /donnees/emlmd/netcdf-4.0.1_g95/include35 # #endif36 #### #23 #### If you want you can set environment variables here (instead of 24 #### relying on the C-shell environment variables) 25 # default LMDGCM to where makegcm script is located: 26 set scriptdir=`dirname $0` 27 setenv LMDGCM `readlink -f $scriptdir` 28 # You may set LIBOGCM to something else; otherwise we default to: 29 setenv LIBOGCM $LMDGCM/libo 30 ## NetCDF Libraries: what follows is OK for LMD 32 and 64bit Linux Machines 31 #if ( `uname -m` == "x86_64" ) then 32 # 64 bit machines 33 setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_g95/lib 34 setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_g95/include 35 #else 36 # setenv NCDFLIB /donnees/emlmd/netcdf-4.0.1_g95/lib 37 # setenv NCDFINC /donnees/emlmd/netcdf-4.0.1_g95/include 38 #endif 39 #### 37 40 38 41 setenv localdir "`pwd`" … … 183 186 # Ehouarn 'g95' compiler 184 187 set optim="-O3 -fstatic -funroll-loops " 185 set optim90=" -O3 -fstatic -funroll-loops " 186 set optimtru90=" -O3 -fstatic -funroll-loops " 187 # set opt_link=" -Mfree -L/usr/local/pgi/linux86/lib -lpgf90 -lpgftnrtl -lpghpf -lpghpf2 -L$NCDFLIB -lnetcdf -Wl,-Bstatic " 188 # Ehouarn: there is no /usr/local/pgi/linux86/lib, but it doesn't matter 189 # also changed -Wl,-Bstatic to -Bstatic 188 set optim90="-O3 -fstatic -funroll-loops " 189 set optimtru90="-O3 -fstatic -funroll-loops " 190 # 190 191 set opt_link=" -L$NCDFLIB -lnetcdf " 191 192 set mod_loc_dir=$localdir … … 217 218 endif 218 219 219 # Ehouarn: add 'g9 5' string to pathname220 # Ehouarn: add 'g9fortran' string to pathname 220 221 set nomlib=${machine}_g95 221 222 … … 405 406 if ( "$physique" == 'nophys' ) then 406 407 set phys="L_PHY= LIBPHY=" 407 endif 408 408 else 409 set src_dirs="$src_dirs aerono$physique phy$physique" 410 set include="$include "'-I$(LIBF)/aerono'"$physique"' -I$(LIBF)/phy'"$physique" 411 endif 412 set libdyn_phy="" 413 set LIBDYN_PHYS="" 409 414 ######################################################################## 410 415 # choix du nombre de traceur par defaut si il n'a pas ete choisi, … … 488 493 set include="$include "'-I$(LIBF)/dyn2d ' 489 494 set dimh=$dim 490 else 495 endif 496 if ( "$dimc" == "3" ) then 491 497 if ( "$dyntype" == "olddyn" ) then 492 498 set include="$include "'-I$(LIBF)/olddyn3d ' 499 set src_dirs="$src_dirs olddyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 493 500 else 494 501 set include="$include "'-I$(LIBF)/dyn3d ' 502 set src_dirs="$src_dirs dyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 495 503 endif 504 set libdyn_phy="-ldynlonlat_phylonlat" 505 set LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a' 496 506 set dimh=`echo $dim | awk ' { print $1 "." $2 } '` 497 507 endif … … 532 542 cat $libf/grid/dimensions.h 533 543 534 #535 544 cd $LMDGCM 536 545 # set path to objects directory … … 553 562 ## NB: we still need to have L_DYN=libdyn3d to reach routines and module 554 563 ## objects which are located in dyn3d 555 set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique " 564 set dyntype="" 565 set filtre="L_DYN= DYN= FILTRE= L_FILTRE= " 566 set dyn="L_DYN= DYN= L_FILTRE= " 567 set dirmain="phy$physique/dyn1d" 568 set src_dirs="$src_dirs phy$physique/dyn1d " 569 set include="$include "' -I$(LIBF)/phy'"$physique"'/dyn1d' 556 570 endif 557 571 endif … … 593 607 if ( `expr $dimc \> 2` == 1 ) then 594 608 set filtre="FILTRE=$filtre" 609 if ( "$dyntype" == "olddyn" ) then 610 set src_dirs="$src_dirs oldfiltrez" 611 else 612 set src_dirs="$src_dirs filtrez" 613 endif 595 614 else 596 set filtre="FILTRE= L_FILTRE= "615 set filtre="FILTRE= L_FILTRE= L_DYN= " 597 616 endif 598 617 echo "MACRO FILTRE $filtre" … … 636 655 \cp tmp90 liste_des_sources_f90 637 656 echo "On recree le makefile" 638 if ("$dyntype" == "olddyn") then 639 ./create_make_gcm olddyn3d grid bibio aeronomars phy$physique >! tmp 640 else 641 ./create_make_gcm dyn3d grid bibio aeronomars phy$physique >! tmp 642 endif 657 echo "src_dirs: $src_dirs" 658 create_make_gcm $src_dirs >! tmp 643 659 \mv tmp makefile 644 660 echo "Nouveau makefile cree." … … 721 737 else if $LINUX then 722 738 # Ehouarn : adapt to g95 723 set optim="$optim -fmod=$ libo"724 set optim90="$optim90 -fmod=$ libo"725 set optimtru90="$optimtru90 -fmod=$ libo"739 set optim="$optim -fmod=${libo}" 740 set optim90="$optim90 -fmod=${libo}" 741 set optimtru90="$optimtru90 -fmod=${libo}" 726 742 # Ehouarn: remove set mod_loc_dir def below; mod_loc_dir=$localdir (set above) 727 743 # set mod_loc_dir=$libo … … 741 757 cd $localdir 742 758 743 ## locate main program (could be in dyn3d or phy$physique744 ## 759 ## locate main program (could be in dyn3d or dynlonlat_phylonlat/phy$physique 760 ## or phy$physique/dyn1d and could be .F or .F90) 745 761 set source_code=${code}.F 762 set dirmain=dyn${dimc}d 746 763 if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then 747 764 set source_code=${code}.F90 748 765 endif 749 if ( -f $LMDGCM/libf/phy${physique}/${code}.F ) then 766 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F ) then 767 set dirmain=phy${physique}/dyn1d 750 768 set source_code=${code}.F 751 769 endif 752 if ( -f $LMDGCM/libf/phy${physique}/${code}.F90 ) then 770 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F90 ) then 771 set dirmain=phy${physique}/dyn1d 753 772 set source_code=${code}.F90 754 773 endif 755 756 ## locate directory where main program is located 757 if ( $dimension == 3 ) then 758 if ( -f $LMDGCM/libf/dyn3d/${source_code} ) then 759 set dyn="DIRMAIN=dyn3d " 760 endif 761 if ( -f $LMDGCM/libf/phy${physique}/${source_code} ) then 762 set dyn="DIRMAIN=phy${physique} " 763 endif 774 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F ) then 775 set dirmain=dynlonlat_phylonlat/phy${physique} 776 set source_code=${code}.F 777 endif 778 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F90 ) then 779 set dirmain=dynlonlat_phylonlat/phy${physique} 780 set source_code=${code}.F90 764 781 endif 765 782 … … 772 789 $filtre \ 773 790 LIBO=$libo \ 774 $dyn \775 791 $phys \ 792 LIBDYN_PHYS=${LIBDYN_PHYS} \ 776 793 DIM=$dimc \ 777 794 DYNTYPE="$dyntype" \ 795 L_DYN_PHY="$libdyn_phy" \ 778 796 L_ADJNT="$adjnt" \ 779 797 LOCAL_DIR="$localdir" \ … … 786 804 MOD_SUFFIX=$mod_suffix \ 787 805 AR=$ar \ 806 DIRMAIN=$dirmain \ 788 807 SOURCE=$source_code \ 789 808 PROG=$code … … 798 817 $filtre \ 799 818 LIBO=$libo \ 800 $dyn \801 819 $phys \ 820 LIBDYN_PHYS=${LIBDYN_PHYS} \ 802 821 DIM=$dimc \ 803 822 DYNTYPE="$dyntype" \ 823 L_DYN_PHY="$libdyn_phy" \ 804 824 L_ADJNT="$adjnt" \ 805 825 LOCAL_DIR="$localdir" \ … … 812 832 MOD_SUFFIX=$mod_suffix \ 813 833 AR=$ar \ 834 DIRMAIN=$dirmain \ 814 835 SOURCE=$source_code \ 815 836 PROG=$code 816 837 817 # cleanup, remove dimensions.h 838 # cleanup, remove dimensions.h 818 839 \rm -f $libf/grid/dimensions.h -
trunk/LMDZ.MARS/makegcm_gfortran
r1246 r1403 8 8 set physique=mars 9 9 set phys="PHYS=$physique" 10 set include='-I$(LIBF)/grid -I$(LIBF)/ bibio -I. -I$(LIBF)/aeronomars'10 set include='-I$(LIBF)/grid -I$(LIBF)/misc -I. -I$(LIBF)/dynlonlat_phylonlat' 11 11 set ntrac = 1 12 12 set filtre=filtrez … … 14 14 set dyntype="dyn" 15 15 set full="" 16 #src_dirs: directories containing source files 17 set src_dirs="grid misc" 18 16 19 ######################################################################## 17 20 # path a changer contenant les sources et les objets du modele … … 403 406 if ( "$physique" == 'nophys' ) then 404 407 set phys="L_PHY= LIBPHY=" 405 endif 406 408 else 409 set src_dirs="$src_dirs aerono$physique phy$physique" 410 set include="$include "'-I$(LIBF)/aerono'"$physique"' -I$(LIBF)/phy'"$physique" 411 endif 412 set libdyn_phy="" 413 set LIBDYN_PHYS="" 407 414 ######################################################################## 408 415 # choix du nombre de traceur par defaut si il n'a pas ete choisi, … … 486 493 set include="$include "'-I$(LIBF)/dyn2d ' 487 494 set dimh=$dim 488 else 495 endif 496 if ( "$dimc" == "3" ) then 489 497 if ( "$dyntype" == "olddyn" ) then 490 498 set include="$include "'-I$(LIBF)/olddyn3d ' 499 set src_dirs="$src_dirs olddyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 491 500 else 492 501 set include="$include "'-I$(LIBF)/dyn3d ' 502 set src_dirs="$src_dirs dyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 493 503 endif 504 set libdyn_phy="-ldynlonlat_phylonlat" 505 set LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a' 494 506 set dimh=`echo $dim | awk ' { print $1 "." $2 } '` 495 507 endif … … 550 562 ## NB: we still need to have L_DYN=libdyn3d to reach routines and module 551 563 ## objects which are located in dyn3d 552 set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique " 564 set dyntype="" 565 set filtre="L_DYN= DYN= FILTRE= L_FILTRE= " 566 set dyn="L_DYN= DYN= L_FILTRE= " 567 set dirmain="phy$physique/dyn1d" 568 set src_dirs="$src_dirs phy$physique/dyn1d " 569 set include="$include "' -I$(LIBF)/phy'"$physique"'/dyn1d' 553 570 endif 554 571 endif … … 590 607 if ( `expr $dimc \> 2` == 1 ) then 591 608 set filtre="FILTRE=$filtre" 609 if ( "$dyntype" == "olddyn" ) then 610 set src_dirs="$src_dirs oldfiltrez" 611 else 612 set src_dirs="$src_dirs filtrez" 613 endif 592 614 else 593 set filtre="FILTRE= L_FILTRE= "615 set filtre="FILTRE= L_FILTRE= L_DYN= " 594 616 endif 595 617 echo "MACRO FILTRE $filtre" … … 633 655 \cp tmp90 liste_des_sources_f90 634 656 echo "On recree le makefile" 635 if ("$dyntype" == "olddyn") then 636 ./create_make_gcm olddyn3d grid bibio aeronomars phy$physique >! tmp 637 else 638 ./create_make_gcm dyn3d grid bibio aeronomars phy$physique >! tmp 639 endif 657 echo "src_dirs: $src_dirs" 658 create_make_gcm $src_dirs >! tmp 640 659 \mv tmp makefile 641 660 echo "Nouveau makefile cree." … … 738 757 cd $localdir 739 758 740 ## locate main program (could be in dyn3d or phy$physique741 ## 759 ## locate main program (could be in dyn3d or dynlonlat_phylonlat/phy$physique 760 ## or phy$physique/dyn1d and could be .F or .F90) 742 761 set source_code=${code}.F 762 set dirmain=dyn${dimc}d 743 763 if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then 744 764 set source_code=${code}.F90 745 765 endif 746 if ( -f $LMDGCM/libf/phy${physique}/${code}.F ) then 766 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F ) then 767 set dirmain=phy${physique}/dyn1d 747 768 set source_code=${code}.F 748 769 endif 749 if ( -f $LMDGCM/libf/phy${physique}/${code}.F90 ) then 770 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F90 ) then 771 set dirmain=phy${physique}/dyn1d 750 772 set source_code=${code}.F90 751 773 endif 752 753 ## locate directory where main program is located 754 if ( $dimension == 3 ) then 755 if ( -f $LMDGCM/libf/dyn3d/${source_code} ) then 756 set dyn="DIRMAIN=dyn3d " 757 endif 758 if ( -f $LMDGCM/libf/phy${physique}/${source_code} ) then 759 set dyn="DIRMAIN=phy${physique} " 760 endif 774 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F ) then 775 set dirmain=dynlonlat_phylonlat/phy${physique} 776 set source_code=${code}.F 777 endif 778 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F90 ) then 779 set dirmain=dynlonlat_phylonlat/phy${physique} 780 set source_code=${code}.F90 761 781 endif 762 782 … … 769 789 $filtre \ 770 790 LIBO=$libo \ 771 $dyn \772 791 $phys \ 792 LIBDYN_PHYS=${LIBDYN_PHYS} \ 773 793 DIM=$dimc \ 774 794 DYNTYPE="$dyntype" \ 795 L_DYN_PHY="$libdyn_phy" \ 775 796 L_ADJNT="$adjnt" \ 776 797 LOCAL_DIR="$localdir" \ … … 783 804 MOD_SUFFIX=$mod_suffix \ 784 805 AR=$ar \ 806 DIRMAIN=$dirmain \ 785 807 SOURCE=$source_code \ 786 808 PROG=$code … … 795 817 $filtre \ 796 818 LIBO=$libo \ 797 $dyn \798 819 $phys \ 820 LIBDYN_PHYS=${LIBDYN_PHYS} \ 799 821 DIM=$dimc \ 800 822 DYNTYPE="$dyntype" \ 823 L_DYN_PHY="$libdyn_phy" \ 801 824 L_ADJNT="$adjnt" \ 802 825 LOCAL_DIR="$localdir" \ … … 809 832 MOD_SUFFIX=$mod_suffix \ 810 833 AR=$ar \ 834 DIRMAIN=$dirmain \ 811 835 SOURCE=$source_code \ 812 836 PROG=$code -
trunk/LMDZ.MARS/makegcm_ifort
r1354 r1403 8 8 set physique=mars 9 9 set phys="PHYS=$physique" 10 set include='-I$(LIBF)/grid -I$(LIBF)/ bibio -I. -I$(LIBF)/aeronomars'10 set include='-I$(LIBF)/grid -I$(LIBF)/misc -I. -I$(LIBF)/dynlonlat_phylonlat' 11 11 set ntrac = 1 12 12 set filtre=filtrez … … 14 14 set dyntype="dyn" 15 15 set full="" 16 #src_dirs: directories containing source files 17 set src_dirs="grid misc" 18 16 19 ######################################################################## 17 20 # path a changer contenant les sources et les objets du modele … … 416 419 if ( "$physique" == 'nophys' ) then 417 420 set phys="L_PHY= LIBPHY=" 418 endif 419 421 else 422 set src_dirs="$src_dirs aerono$physique phy$physique" 423 set include="$include "'-I$(LIBF)/aerono'"$physique"' -I$(LIBF)/phy'"$physique" 424 endif 425 set libdyn_phy="" 426 set LIBDYN_PHYS="" 420 427 ######################################################################## 421 428 # choix du nombre de traceur par defaut si il n'a pas ete choisi, … … 499 506 set include="$include "'-I$(LIBF)/dyn2d ' 500 507 set dimh=$dim 501 else 508 endif 509 if ( "$dimc" == "3" ) then 502 510 if ( "$dyntype" == "olddyn" ) then 503 511 set include="$include "'-I$(LIBF)/olddyn3d ' 512 set src_dirs="$src_dirs olddyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 504 513 else 505 514 set include="$include "'-I$(LIBF)/dyn3d ' 515 set src_dirs="$src_dirs dyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 506 516 endif 517 set libdyn_phy="-ldynlonlat_phylonlat" 518 set LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a' 507 519 set dimh=`echo $dim | awk ' { print $1 "." $2 } '` 508 520 endif … … 563 575 ## NB: we still need to have L_DYN=libdyn3d to reach routines and module 564 576 ## objects which are located in dyn3d 565 set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique " 577 set dyntype="" 578 set filtre="L_DYN= DYN= FILTRE= L_FILTRE= " 579 set dyn="L_DYN= DYN= L_FILTRE= " 580 set dirmain="phy$physique/dyn1d" 581 set src_dirs="$src_dirs phy$physique/dyn1d " 582 set include="$include "' -I$(LIBF)/phy'"$physique"'/dyn1d' 566 583 endif 567 584 endif … … 603 620 if ( `expr $dimc \> 2` == 1 ) then 604 621 set filtre="FILTRE=$filtre" 622 if ( "$dyntype" == "olddyn" ) then 623 set src_dirs="$src_dirs oldfiltrez" 624 else 625 set src_dirs="$src_dirs filtrez" 626 endif 605 627 else 606 set filtre="FILTRE= L_FILTRE= "628 set filtre="FILTRE= L_FILTRE= L_DYN= " 607 629 endif 608 630 echo "MACRO FILTRE $filtre" … … 646 668 \cp tmp90 liste_des_sources_f90 647 669 echo "On recree le makefile" 648 if ("$dyntype" == "olddyn") then 649 ./create_make_gcm olddyn3d grid bibio aeronomars phy$physique >! tmp 650 else 651 ./create_make_gcm dyn3d grid bibio aeronomars phy$physique >! tmp 652 endif 670 echo "src_dirs: $src_dirs" 671 create_make_gcm $src_dirs >! tmp 653 672 \mv tmp makefile 654 673 echo "Nouveau makefile cree." … … 750 769 cd $localdir 751 770 752 ## locate main program (could be in dyn3d or phy$physique753 ## 771 ## locate main program (could be in dyn3d or dynlonlat_phylonlat/phy$physique 772 ## or phy$physique/dyn1d and could be .F or .F90) 754 773 set source_code=${code}.F 774 set dirmain=dyn${dimc}d 755 775 if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then 756 776 set source_code=${code}.F90 757 777 endif 758 if ( -f $LMDGCM/libf/phy${physique}/${code}.F ) then 778 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F ) then 779 set dirmain=phy${physique}/dyn1d 759 780 set source_code=${code}.F 760 781 endif 761 if ( -f $LMDGCM/libf/phy${physique}/${code}.F90 ) then 782 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F90 ) then 783 set dirmain=phy${physique}/dyn1d 762 784 set source_code=${code}.F90 763 785 endif 764 765 ## locate directory where main program is located 766 if ( $dimension == 3 ) then 767 if ( -f $LMDGCM/libf/dyn3d/${source_code} ) then 768 set dyn="DIRMAIN=dyn3d " 769 endif 770 if ( -f $LMDGCM/libf/phy${physique}/${source_code} ) then 771 set dyn="DIRMAIN=phy${physique} " 772 endif 786 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F ) then 787 set dirmain=dynlonlat_phylonlat/phy${physique} 788 set source_code=${code}.F 789 endif 790 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F90 ) then 791 set dirmain=dynlonlat_phylonlat/phy${physique} 792 set source_code=${code}.F90 773 793 endif 774 794 … … 781 801 $filtre \ 782 802 LIBO=$libo \ 783 $dyn \784 803 $phys \ 804 LIBDYN_PHYS=${LIBDYN_PHYS} \ 785 805 DIM=$dimc \ 786 806 DYNTYPE="$dyntype" \ 807 L_DYN_PHY="$libdyn_phy" \ 787 808 L_ADJNT="$adjnt" \ 788 809 LOCAL_DIR="$localdir" \ … … 795 816 MOD_SUFFIX=$mod_suffix \ 796 817 AR=$ar \ 818 DIRMAIN=$dirmain \ 797 819 SOURCE=$source_code \ 798 820 PROG=$code … … 807 829 $filtre \ 808 830 LIBO=$libo \ 809 $dyn \810 831 $phys \ 832 LIBDYN_PHYS=${LIBDYN_PHYS} \ 811 833 DIM=$dimc \ 812 834 DYNTYPE="$dyntype" \ 835 L_DYN_PHY="$libdyn_phy" \ 813 836 L_ADJNT="$adjnt" \ 814 837 LOCAL_DIR="$localdir" \ … … 821 844 MOD_SUFFIX=$mod_suffix \ 822 845 AR=$ar \ 846 DIRMAIN=$dirmain \ 823 847 SOURCE=$source_code \ 824 848 PROG=$code 825 849 826 # cleanup, remove dimensions.h 850 # cleanup, remove dimensions.h 827 851 \rm -f $libf/grid/dimensions.h -
trunk/LMDZ.MARS/makegcm_pgf
r1246 r1403 8 8 set physique=mars 9 9 set phys="PHYS=$physique" 10 set include='-I$(LIBF)/grid -I$(LIBF)/ bibio -I. -I$(LIBF)/aeronomars'10 set include='-I$(LIBF)/grid -I$(LIBF)/misc -I. -I$(LIBF)/dynlonlat_phylonlat' 11 11 set ntrac = 1 12 12 set filtre=filtrez … … 14 14 set dyntype="dyn" 15 15 set full="" 16 #src_dirs: directories containing source files 17 set src_dirs="grid misc" 18 16 19 ######################################################################## 17 20 # path a changer contenant les sources et les objets du modele … … 27 30 ## NetCDF Libraries: what follows is OK for LMD 32 and 64bit Linux Machines 28 31 #if ( `uname -m` == "x86_64" ) then 29 # #64 bit machines32 # 64 bit machines 30 33 setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_pgi/lib 31 34 setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_pgi/include … … 35 38 #endif 36 39 #### 37 38 40 39 41 setenv localdir "`pwd`" … … 221 223 endif 222 224 223 set nomlib=$machine 225 # Ehouarn: add 'g9fortran' string to pathname 226 set nomlib=${machine} 224 227 225 228 # Impose distinct name for 64 bit Linux machines (to avoid mixing 32 and 64) 226 229 if (`uname` == Linux && `uname -m` == "x86_64") then 227 set nomlib=${machine} 64230 set nomlib=${machine} 228 231 endif 229 232 … … 407 410 if ( "$physique" == 'nophys' ) then 408 411 set phys="L_PHY= LIBPHY=" 409 endif 410 412 else 413 set src_dirs="$src_dirs aerono$physique phy$physique" 414 set include="$include "'-I$(LIBF)/aerono'"$physique"' -I$(LIBF)/phy'"$physique" 415 endif 416 set libdyn_phy="" 417 set LIBDYN_PHYS="" 411 418 ######################################################################## 412 419 # choix du nombre de traceur par defaut si il n'a pas ete choisi, … … 490 497 set include="$include "'-I$(LIBF)/dyn2d ' 491 498 set dimh=$dim 492 else 499 endif 500 if ( "$dimc" == "3" ) then 493 501 if ( "$dyntype" == "olddyn" ) then 494 502 set include="$include "'-I$(LIBF)/olddyn3d ' 503 set src_dirs="$src_dirs olddyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 495 504 else 496 505 set include="$include "'-I$(LIBF)/dyn3d ' 506 set src_dirs="$src_dirs dyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 497 507 endif 508 set libdyn_phy="-ldynlonlat_phylonlat" 509 set LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a' 498 510 set dimh=`echo $dim | awk ' { print $1 "." $2 } '` 499 511 endif … … 554 566 ## NB: we still need to have L_DYN=libdyn3d to reach routines and module 555 567 ## objects which are located in dyn3d 556 set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique " 568 set dyntype="" 569 set filtre="L_DYN= DYN= FILTRE= L_FILTRE= " 570 set dyn="L_DYN= DYN= L_FILTRE= " 571 set dirmain="phy$physique/dyn1d" 572 set src_dirs="$src_dirs phy$physique/dyn1d " 573 set include="$include "' -I$(LIBF)/phy'"$physique"'/dyn1d' 557 574 endif 558 575 endif … … 594 611 if ( `expr $dimc \> 2` == 1 ) then 595 612 set filtre="FILTRE=$filtre" 613 if ( "$dyntype" == "olddyn" ) then 614 set src_dirs="$src_dirs oldfiltrez" 615 else 616 set src_dirs="$src_dirs filtrez" 617 endif 596 618 else 597 set filtre="FILTRE= L_FILTRE= "619 set filtre="FILTRE= L_FILTRE= L_DYN= " 598 620 endif 599 621 echo "MACRO FILTRE $filtre" … … 637 659 \cp tmp90 liste_des_sources_f90 638 660 echo "On recree le makefile" 639 if ("$dyntype" == "olddyn") then 640 ./create_make_gcm olddyn3d grid bibio aeronomars phy$physique >! tmp 641 else 642 ./create_make_gcm dyn3d grid bibio aeronomars phy$physique >! tmp 643 endif 661 echo "src_dirs: $src_dirs" 662 create_make_gcm $src_dirs >! tmp 644 663 \mv tmp makefile 645 664 echo "Nouveau makefile cree." … … 739 758 cd $localdir 740 759 741 ## locate main program (could be in dyn3d or phy$physique742 ## 760 ## locate main program (could be in dyn3d or dynlonlat_phylonlat/phy$physique 761 ## or phy$physique/dyn1d and could be .F or .F90) 743 762 set source_code=${code}.F 763 set dirmain=dyn${dimc}d 744 764 if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then 745 765 set source_code=${code}.F90 746 766 endif 747 if ( -f $LMDGCM/libf/phy${physique}/${code}.F ) then 767 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F ) then 768 set dirmain=phy${physique}/dyn1d 748 769 set source_code=${code}.F 749 770 endif 750 if ( -f $LMDGCM/libf/phy${physique}/${code}.F90 ) then 771 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F90 ) then 772 set dirmain=phy${physique}/dyn1d 751 773 set source_code=${code}.F90 752 774 endif 753 754 ## locate directory where main program is located 755 if ( $dimension == 3 ) then 756 if ( -f $LMDGCM/libf/dyn3d/${source_code} ) then 757 set dyn="DIRMAIN=dyn3d " 758 endif 759 if ( -f $LMDGCM/libf/phy${physique}/${source_code} ) then 760 set dyn="DIRMAIN=phy${physique} " 761 endif 775 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F ) then 776 set dirmain=dynlonlat_phylonlat/phy${physique} 777 set source_code=${code}.F 778 endif 779 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F90 ) then 780 set dirmain=dynlonlat_phylonlat/phy${physique} 781 set source_code=${code}.F90 762 782 endif 763 783 … … 770 790 $filtre \ 771 791 LIBO=$libo \ 772 $dyn \773 792 $phys \ 793 LIBDYN_PHYS=${LIBDYN_PHYS} \ 774 794 DIM=$dimc \ 775 795 DYNTYPE="$dyntype" \ 796 L_DYN_PHY="$libdyn_phy" \ 776 797 L_ADJNT="$adjnt" \ 777 798 LOCAL_DIR="$localdir" \ … … 784 805 MOD_SUFFIX=$mod_suffix \ 785 806 AR=$ar \ 807 DIRMAIN=$dirmain \ 786 808 SOURCE=$source_code \ 787 809 PROG=$code … … 796 818 $filtre \ 797 819 LIBO=$libo \ 798 $dyn \799 820 $phys \ 821 LIBDYN_PHYS=${LIBDYN_PHYS} \ 800 822 DIM=$dimc \ 801 823 DYNTYPE="$dyntype" \ 824 L_DYN_PHY="$libdyn_phy" \ 802 825 L_ADJNT="$adjnt" \ 803 826 LOCAL_DIR="$localdir" \ … … 810 833 MOD_SUFFIX=$mod_suffix \ 811 834 AR=$ar \ 835 DIRMAIN=$dirmain \ 812 836 SOURCE=$source_code \ 813 837 PROG=$code 814 838 815 # cleanup, remove dimensions.h 839 # cleanup, remove dimensions.h 816 840 \rm -f $libf/grid/dimensions.h -
trunk/LMDZ.TITAN/libf/phytitan/dyn1d/rcm1d.F
r1401 r1403 466 466 c*********************************************************************** 467 467 468 #include "../dyn3d_common/disvert_noterre.F"469 #include "../dyn3d/abort_gcm.F"468 !#include "../dyn3d_common/disvert_noterre.F" 469 !#include "../dyn3d/abort_gcm.F" -
trunk/LMDZ.VENUS/libf/phyvenus/dyn1d/rcm1d.F
r1401 r1403 473 473 c*********************************************************************** 474 474 475 #include "../dyn3d_common/disvert_noterre.F"476 #include "../dyn3d/abort_gcm.F"477 475 !#include "../dyn3d_common/disvert_noterre.F" 476 !#include "../dyn3d/abort_gcm.F" 477
Note: See TracChangeset
for help on using the changeset viewer.