Changeset 1403 for trunk/LMDZ.GENERIC
- Timestamp:
- Mar 31, 2015, 3:49:07 PM (10 years ago)
- Location:
- trunk/LMDZ.GENERIC
- Files:
-
- 32 added
- 11 edited
- 29 moved
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.