- Timestamp:
- Jul 20, 2024, 11:17:09 PM (5 months ago)
- Location:
- LMDZ6/branches/Amaury_dev
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/dyn3d/dynetat0.F90
r5088 r5091 19 19 USE temps_mod, ONLY: annee_ref, day_ini, day_ref, itau_dyn, start_time 20 20 USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0 21 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA 21 22 22 23 IMPLICIT NONE … … 140 141 ix = strIdx(newHNO3, var); IF(ix /= 0) oldVar = oldHNO3(ix) !--- REPROBUS HNO3 exceptions 141 142 #endif 142 #ifdef INCA 143 IF(var == 'O3') oldVar = 'OX' !--- DEAL WITH INCA OZONE EXCEPTION144 #endif 143 IF (CPPKEY_INCA) THEN 144 IF(var == 'O3') oldVar = 'OX' !--- DEAL WITH INCA OZONE EXCEPTION 145 END IF 145 146 !-------------------------------------------------------------------------------------------------------------------------- 146 147 IF(NF90_INQ_VARID(fID, var, vID) == NF90_NoErr .AND. .NOT.lSkip) THEN !=== REGULAR CASE: AVAILABLE VARIABLE -
LMDZ6/branches/Amaury_dev/libf/dyn3d/integrd.F
r5082 r5091 182 182 c$$$ IF( iadv(1).NE.3.AND.iadv(2).NE.3 ) THEN 183 183 c$$$c 184 c$$$ IF( forward . OR .leapf ) THEN184 c$$$ IF( forward .OR. leapf ) THEN 185 185 c$$$ DO iq = 1,2 186 186 c$$$ DO l = 1,llm -
LMDZ6/branches/Amaury_dev/libf/dyn3d/leapfrog.F
r5090 r5091 344 344 & 'leapfrog 686: avant caladvtrac') 345 345 346 IF( forward . OR .leapf ) THEN346 IF( forward .OR. leapf ) THEN 347 347 ! Ehouarn: NB: fields sent to advtrac are those at the beginning of the time step 348 348 CALL caladvtrac(q,pbaru,pbarv, … … 363 363 ENDIF ! of IF (offline) 364 364 c 365 ENDIF ! of IF( forward . OR .leapf )365 ENDIF ! of IF( forward .OR. leapf ) 366 366 367 367 … … 390 390 IF( itau==itaufin.AND..NOT.forward ) lafin = .TRUE. 391 391 ELSE 392 IF( itau+1 . EQ.itaufin ) lafin = .TRUE.392 IF( itau+1 == itaufin ) lafin = .TRUE. 393 393 ENDIF 394 394 c … … 634 634 c ........................................................ 635 635 636 IF(forward .OR. leapf) THEN636 IF(forward .OR. leapf) THEN 637 637 itau= itau + 1 638 638 c iday= day_ini+itau/day_step … … 645 645 646 646 647 IF( itau . EQ. itaufinp1 ) then647 IF( itau == itaufinp1 ) then 648 648 if (flag_verif) then 649 649 write(79,*) 'ucov',ucov … … 746 746 IF( MOD(itau,iperiod)==0 ) THEN 747 747 GO TO 1 748 ELSE IF ( MOD(itau-1,iperiod) . EQ.0 ) THEN748 ELSE IF ( MOD(itau-1,iperiod) == 0 ) THEN 749 749 750 750 IF( forward ) THEN … … 791 791 792 792 forward = .FALSE. 793 IF( itau . EQ. itaufinp1 ) then793 IF( itau == itaufinp1 ) then 794 794 abort_message = 'Simulation finished' 795 795 call abort_gcm(modname,abort_message,0) … … 801 801 call check_isotopes_seq(q,ip1jmp1,'leapfrog 1698') 802 802 803 IF(MOD(itau,iperiod) .EQ.0 .OR. itau.EQ.itaufin) THEN804 IF(itau .EQ.itaufin) THEN803 IF(MOD(itau,iperiod)==0 .OR. itau==itaufin) THEN 804 IF(itau==itaufin) THEN 805 805 iav=1 806 806 ELSE … … 826 826 ENDIF ! of IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) 827 827 828 IF(MOD(itau,iecri ) .EQ.0) THEN828 IF(MOD(itau,iecri )==0) THEN 829 829 c IF(MOD(itau,iecri*day_step).EQ.0) THEN 830 830 CALL geopot(ip1jmp1,teta,pk,pks,phis,phi) … … 848 848 ENDIF ! of IF(MOD(itau,iecri ).EQ.0) 849 849 850 IF(itau .EQ.itaufin) THEN850 IF(itau==itaufin) THEN 851 851 ! if (planet_type.eq."earth") then 852 852 CALL dynredem1("restart.nc",start_time, -
LMDZ6/branches/Amaury_dev/libf/dyn3d_common/infotrac.F90
r5082 r5091 117 117 USE CHEM_REP, ONLY: Init_chem_rep_trac 118 118 #endif 119 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA 119 120 IMPLICIT NONE 120 121 !============================================================================================================================== … … 143 144 ! Local variables 144 145 INTEGER, ALLOCATABLE :: hadv(:), vadv(:) !--- Horizontal/vertical transport scheme number 145 #ifdef INCA146 146 INTEGER, ALLOCATABLE :: had (:), hadv_inca(:), conv_flg_inca(:), &!--- Variables specific to INCA 147 147 vad (:), vadv_inca(:), pbl_flg_inca(:) 148 148 CHARACTER(LEN=8), ALLOCATABLE :: solsym_inca(:) !--- Tracers names for INCA 149 149 INTEGER :: nqINCA 150 #endif151 150 CHARACTER(LEN=2) :: suff(9) !--- Suffixes for schemes of order 3 or 4 (Prather) 152 151 CHARACTER(LEN=3) :: descrq(30) !--- Advection scheme description tags … … 197 196 SELECT CASE(type_trac) 198 197 CASE('inca', 'inco') 199 #ifndef INCA 198 IF (CPPKEY_INCA) THEN 200 199 CALL abort_gcm(modname, 'You must add cpp key INCA and compile with INCA code', 1) 201 #endif 200 END IF 202 201 CASE('repr') 203 202 #ifndef REPROBUS … … 229 228 IF(fType == 1 .AND. ANY(['inca','inco']==type_trac)) THEN !=== FOUND OLD STYLE INCA "traceur.def" 230 229 !--------------------------------------------------------------------------------------------------------------------------- 231 #ifdef INCA 230 IF (CPPKEY_INCA) THEN 232 231 nqo = SIZE(tracers) - nqCO2 233 232 CALL Init_chem_inca_trac(nqINCA) !--- Get nqINCA from INCA … … 260 259 IF(setGeneration(tracers)) CALL abort_gcm(modname,'See above',1) !- SET FIELDS %iGeneration, %gen0Name 261 260 DEALLOCATE(had, hadv_inca, vad, vadv_inca, conv_flg_inca, pbl_flg_inca, solsym_inca) 262 #endif 261 END IF 263 262 !--------------------------------------------------------------------------------------------------------------------------- 264 263 ELSE !=== OTHER CASES (OLD OR NEW FORMAT, NO INCA MODULE) … … 269 268 nbtr = nqtrue-COUNT(delPhase(tracers(:)%gen0Name) == 'H2O' & 270 269 .AND. tracers(:)%component == 'lmdz') !--- Number of tracers passed to phytrac 271 #ifdef INCA 270 IF (CPPKEY_INCA) THEN 272 271 nqINCA = COUNT(tracers(:)%component == 'inca') 273 #endif 272 END IF 274 273 lerr = getKey('hadv', hadv, ky=tracers(:)%keys) 275 274 lerr = getKey('vadv', vadv, ky=tracers(:)%keys) … … 400 399 CALL msg('niso = '//TRIM(int2str(niso)), modname) 401 400 CALL msg('ntiso = '//TRIM(int2str(ntiso)), modname) 402 #ifdef INCA 403 CALL msg('nqCO2 = '//TRIM(int2str(nqCO2)), modname)404 CALL msg('nqINCA = '//TRIM(int2str(nqINCA)), modname)405 #endif 401 IF (CPPKEY_INCA) THEN 402 CALL msg('nqCO2 = '//TRIM(int2str(nqCO2)), modname) 403 CALL msg('nqINCA = '//TRIM(int2str(nqINCA)), modname) 404 END IF 406 405 t => tracers 407 406 CALL msg('Information stored in infotrac :', modname) -
LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inigeom.F
r5086 r5091 348 348 DO j = 1, jjp1 349 349 c 350 IF ( j . eq.1 ) THEN350 IF ( j == 1 ) THEN 351 351 c 352 352 yprm = yprimu1(j) … … 378 378 END IF 379 379 c 380 IF ( j . eq.jjp1 ) THEN380 IF ( j == jjp1 ) THEN 381 381 yprp = yprimu2(j-1) 382 382 rlatp = rlatu2 (j-1) -
LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynetat0_loc.F90
r5088 r5091 20 20 USE temps_mod, ONLY: annee_ref, day_ini, day_ref, itau_dyn, start_time 21 21 USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0 22 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA 22 23 23 24 IMPLICIT NONE … … 165 166 ix = strIdx(newHNO3, var); IF(ix /= 0) oldVar = oldHNO3(ix) !--- REPROBUS HNO3 exceptions 166 167 #endif 167 #ifdef INCA 168 IF(var == 'O3') oldVar = 'OX' !--- DEAL WITH INCA OZONE EXCEPTION169 #endif 168 IF (CPPKEY_INCA) THEN 169 IF(var == 'O3') oldVar = 'OX' !--- DEAL WITH INCA OZONE EXCEPTION 170 END IF 170 171 !-------------------------------------------------------------------------------------------------------------------------- 171 172 IF(NF90_INQ_VARID(fID, var, vID) == NF90_NoErr .AND. .NOT.lSkip) THEN !=== REGULAR CASE: AVAILABLE VARIABLE -
LMDZ6/branches/Amaury_dev/libf/dyn3dmem/filtreg_p.F
r5082 r5091 361 361 362 362 IF (jdfil<=jffil) THEN 363 IF( ifiltre . EQ.-2 ) THEN363 IF( ifiltre == -2 ) THEN 364 364 CALL Filtre_inv_fft(champ_fft,nlat,jdfil,jffil,nbniv) 365 365 ELSE IF ( griscal ) THEN -
LMDZ6/branches/Amaury_dev/libf/dyn3dmem/leapfrog_loc.F
r5082 r5091 46 46 & xios_set_current_context, 47 47 & using_xios 48 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA 48 49 49 50 IMPLICIT NONE … … 313 314 c ----- 314 315 315 jD_cur = jD_ref + day_ini - day_ref + &316 jD_cur = jD_ref + day_ini - day_ref + 316 317 & (itau+1)/day_step 317 jH_cur = jH_ref + start_time + &318 jH_cur = jH_ref + start_time + 318 319 & mod(itau+1,day_step)/float(day_step) 319 320 if (jH_cur > 1.0 ) then … … 494 495 if (Adjust) then 495 496 AdjustCount=AdjustCount+1 496 ! if (iapptrac==iapp_tracvl .and. (forward . OR .leapf)497 ! if (iapptrac==iapp_tracvl .and. (forward .OR. leapf) 497 498 ! & .and. itau/iphysiq>2 .and. Adjustcount>30) then 498 499 if (Adjustcount>1) then … … 714 715 & 'leapfrog 686: avant caladvtrac') 715 716 716 IF( forward . OR .leapf ) THEN717 IF( forward .OR. leapf ) THEN 717 718 ! Ehouarn: NB: fields sent to advtrac are those at the beginning of the time step 718 719 !write(*,*) 'leapfrog 679: avant CALL caladvtrac_loc' … … 736 737 ! Ehouarn: Storage of mass flux for off-line tracers... not implemented... 737 738 738 ENDIF ! of IF( forward . OR .leapf )739 ENDIF ! of IF( forward .OR. leapf ) 739 740 740 741 … … 808 809 IF( itau==itaufin.AND..NOT.forward ) lafin = .TRUE. 809 810 ELSE 810 IF( itau+1 . EQ.itaufin ) lafin = .TRUE.811 IF( itau+1 == itaufin ) lafin = .TRUE. 811 812 ENDIF 812 813 … … 1519 1520 endif 1520 1521 1521 #ifdef INCA 1522 IF (CPPKEY_INCA) THEN 1522 1523 IF (ANY(type_trac == ['inca','inco'])) THEN 1523 1524 CALL finalize_inca … … 1529 1530 !$OMP END MASTER 1530 1531 ENDIF 1531 #endif 1532 END IF 1532 1533 #ifdef REPROBUS 1533 1534 if (type_trac == 'repr') CALL finalize_reprobus … … 1548 1549 c ........................................................ 1549 1550 1550 IF(forward .OR. leapf) THEN1551 IF(forward .OR. leapf) THEN 1551 1552 itau= itau + 1 1552 1553 ! iday= day_ini+itau/day_step … … 1559 1560 1560 1561 1561 IF( itau . EQ.itaufinp1 ) then1562 IF( itau == itaufinp1 ) then 1562 1563 1563 1564 if (flag_verif) then … … 1576 1577 c$OMP END MASTER 1577 1578 1578 #ifdef INCA 1579 IF (CPPKEY_INCA) THEN 1579 1580 IF (ANY(type_trac == ['inca','inco'])) THEN 1580 1581 CALL finalize_inca … … 1586 1587 !$OMP END MASTER 1587 1588 ENDIF 1588 #endif 1589 END IF 1589 1590 #ifdef REPROBUS 1590 1591 if (type_trac == 'repr') CALL finalize_reprobus … … 1697 1698 IF( MOD(itau,iperiod)==0 ) THEN 1698 1699 GO TO 1 1699 ELSE IF ( MOD(itau-1,iperiod) . EQ.0 ) THEN1700 ELSE IF ( MOD(itau-1,iperiod) == 0 ) THEN 1700 1701 1701 1702 IF( forward ) THEN … … 1744 1745 1745 1746 forward = .FALSE. 1746 IF( itau . EQ. itaufinp1 ) then1747 IF( itau == itaufinp1 ) then 1747 1748 c$OMP MASTER 1748 1749 call fin_getparam 1749 1750 c$OMP END MASTER 1750 1751 1751 #ifdef INCA 1752 IF (CPPKEY_INCA) THEN 1752 1753 IF (ANY(type_trac == ['inca','inco'])) THEN 1753 1754 CALL finalize_inca … … 1760 1761 ENDIF 1761 1762 1762 #endif 1763 END IF 1763 1764 #ifdef REPROBUS 1764 1765 if (type_trac == 'repr') CALL finalize_reprobus … … 1779 1780 call check_isotopes(q,ijb_u,ije_u,'leapfrog 1698') 1780 1781 1781 IF(MOD(itau,iperiod) .EQ.0 .OR. itau.EQ.itaufin) THEN1782 IF(itau .EQ.itaufin) THEN1782 IF(MOD(itau,iperiod)==0 .OR. itau==itaufin) THEN 1783 IF(itau==itaufin) THEN 1783 1784 iav=1 1784 1785 ELSE … … 1809 1810 1810 1811 1811 IF(MOD(itau,iecri ) .EQ.0) THEN1812 IF(MOD(itau,iecri )==0) THEN 1812 1813 1813 1814 c$OMP BARRIER … … 1837 1838 1838 1839 1839 IF(itau .EQ.itaufin) THEN1840 IF(itau==itaufin) THEN 1840 1841 ! if (planet_type.eq."earth") then 1841 1842 CALL dynredem1_loc("restart.nc",0.0, … … 1863 1864 c$OMP END MASTER 1864 1865 1865 #ifdef INCA 1866 IF (CPPKEY_INCA) THEN 1866 1867 IF (ANY(type_trac == ['inca','inco'])) THEN 1867 1868 CALL finalize_inca … … 1873 1874 !$OMP END MASTER 1874 1875 ENDIF 1875 1876 #endif 1876 END IF 1877 1877 #ifdef REPROBUS 1878 1878 if (type_trac == 'repr') CALL finalize_reprobus -
LMDZ6/branches/Amaury_dev/libf/dyn3dmem/mod_filtreg_p.F
r5082 r5091 369 369 370 370 IF (jdfil<=jffil) THEN 371 IF( ifiltre . EQ.-2 ) THEN371 IF( ifiltre == -2 ) THEN 372 372 CALL Filtre_inv_fft(champ_fft,jjb,jje,jdfil,jffil,nbniv) 373 373 ELSE IF ( griscal ) THEN -
LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/etat0dyn_netcdf.F90
r5087 r5091 77 77 USE infotrac, ONLY: nqtot, tracers 78 78 USE filtreg_mod 79 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA 79 80 IMPLICIT NONE 80 81 !------------------------------------------------------------------------------- … … 145 146 !******************************************************************************* 146 147 ! Look for ozone tracer: 147 #ifndef INCA 148 IF (CPPKEY_INCA) THEN 148 149 DO iq=1,nqtot; IF(strLower(tracers(iq)%name)=="o3") EXIT; END DO 149 150 IF(iq/=nqtot+1) THEN … … 153 154 q3d(:,:,:,iq)=q3d(:,:,:,iq)*48./ 29. !--- Mole->mass fraction 154 155 END IF 155 #endif 156 END IF 156 157 q3d(iip1,:,:,:)=q3d(1,:,:,:) 157 158 -
LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90
r5082 r5091 38 38 USE phyaqua_mod, ONLY: iniaqua 39 39 USE comconst_mod, ONLY: omeg, rad 40 #ifdef INCA41 40 USE indice_sol_mod, ONLY: nbsrf, is_oce, is_sic, is_ter, is_lic 42 41 #ifdef CPP_PARA … … 45 44 #endif 46 45 USE mod_phys_lmdz_omp_data, ONLY: klon_omp 47 #endif48 46 USE ioipsl_getin_p_mod, ONLY: getin_p 49 47 USE slab_heat_transp_mod, ONLY: ini_slab_transp_geom 48 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA 50 49 IMPLICIT NONE 51 50 … … 167 166 168 167 IF (ANY(type_trac == ['inca','inco'])) THEN 169 #ifdef INCA 168 IF (CPPKEY_INCA) THEN 170 169 CALL init_inca_dim_reg(nbp_lon, nbp_lat - 1, & 171 170 rlonudyn, rlatudyn, rlonvdyn, rlatvdyn) 172 #endif 171 END IF 173 172 END IF 174 173 -
LMDZ6/branches/Amaury_dev/libf/filtrez/filtreg.F
r5082 r5091 181 181 END DO 182 182 183 IF( hemisph . EQ.1 ) THEN184 185 IF( ifiltre . EQ.-2 ) THEN183 IF( hemisph == 1 ) THEN 184 185 IF( ifiltre == -2 ) THEN 186 186 187 187 DO j = jdfil,jffil … … 229 229 ELSE 230 230 231 IF( ifiltre . EQ.-2 ) THEN231 IF( ifiltre == -2 ) THEN 232 232 233 233 DO j = jdfil,jffil -
LMDZ6/branches/Amaury_dev/libf/misc/lmdz_cppkeys_wrapper.F90
r5090 r5091 7 7 ! NC_DOUBLE -> nf90_format 8 8 ! CPP_PHYS -> CPPKEY_PHYS 9 ! INCA -> CPPKEY_INCA 9 10 ! --------------------------------------------- 10 11 … … 13 14 USE netcdf, ONLY: nf90_float, nf90_double 14 15 IMPLICIT NONE; PRIVATE 15 PUBLIC nf90_format, CPPKEY_PHYS 16 PUBLIC nf90_format, CPPKEY_PHYS, CPPKEY_INCA 16 17 17 18 #ifdef NC_DOUBLE … … 27 28 #endif 28 29 30 #ifdef INCA 31 LOGICAL, PARAMETER :: CPPKEY_INCA = .TRUE. 32 #else 33 LOGICAL, PARAMETER :: CPPKEY_INCA = .FALSE. 34 #endif 35 29 36 END MODULE lmdz_cppkeys_wrapper -
LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_mpi_data.F90
r5082 r5091 49 49 SUBROUTINE init_phys_lmdz_mpi_data(nbp, nbp_lon, nbp_lat, nbp_lev, grid_type, nvertex, communicator) 50 50 USE lmdz_mpi 51 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA 51 52 IMPLICIT NONE 52 53 INTEGER,INTENT(IN) :: nbp … … 174 175 CALL Print_module_data 175 176 176 #ifdef INCA 177 IF (CPPKEY_INCA) THEN 177 178 CALL init_inca_para( & 178 179 nbp_lon,nbp_lat,nbp_lev,klon_glo,mpi_size, & 179 180 distrib,nvertex, grid_type,communicator) 180 #endif 181 END IF 181 182 182 183 END SUBROUTINE Init_phys_lmdz_mpi_data -
LMDZ6/branches/Amaury_dev/libf/phy_common/physics_distribution_mod.F90
r4389 r5091 17 17 USE CHEM_REP, ONLY : Init_chem_rep_phys 18 18 #endif 19 19 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA 20 20 IMPLICIT NONE 21 21 INTEGER,INTENT(IN) :: grid_type … … 33 33 CALL init_dimphy(klon_omp,nbp_lev) 34 34 35 #ifdef INCA 35 IF (CPPKEY_INCA) THEN 36 36 CALL Init_inca_dim(klon_omp,nbp_lev) 37 #endif 37 END IF 38 38 39 39 #ifdef REPROBUS -
LMDZ6/branches/Amaury_dev/libf/phylmd/infotrac_phy.F90
r5082 r5091 136 136 USE CHEM_REP, ONLY: Init_chem_rep_trac 137 137 #endif 138 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA 138 139 IMPLICIT NONE 139 140 !============================================================================================================================== … … 162 163 ! Local variables 163 164 INTEGER, ALLOCATABLE :: hadv(:), vadv(:) !--- Horizontal/vertical transport scheme number 164 #ifdef INCA165 165 INTEGER, ALLOCATABLE :: had (:), hadv_inca(:), conv_flg_inca(:), &!--- Variables specific to INCA 166 166 vad (:), vadv_inca(:), pbl_flg_inca(:) 167 167 CHARACTER(LEN=8), ALLOCATABLE :: solsym_inca(:) !--- Tracers names for INCA 168 168 INTEGER :: nqINCA 169 #endif170 169 #ifdef CPP_StratAer 171 170 CHARACTER(LEN=maxlen), ALLOCATABLE :: tnames(:) … … 224 223 SELECT CASE(type_trac) 225 224 CASE('inca', 'inco') 226 #ifndef INCA 225 IF (CPPKEY_INCA) THEN 227 226 CALL abort_physic(modname, 'You must add cpp key INCA and compile with INCA code', 1) 228 #endif 227 END IF 229 228 CASE('repr') 230 229 #ifndef REPROBUS … … 267 266 IF(fType == 1 .AND. ANY(['inca','inco']==type_trac) .AND. lInit) THEN !=== FOUND OLD STYLE INCA "traceur.def" 268 267 !--------------------------------------------------------------------------------------------------------------------------- 269 #ifdef INCA 268 IF (CPPKEY_INCA) THEN 270 269 nqo = SIZE(tracers) - nqCO2 271 270 CALL Init_chem_inca_trac(nqINCA) !--- Get nqINCA from INCA … … 298 297 IF(setGeneration(tracers)) CALL abort_physic(modname,'See below',1) !- SET FIELDS %iGeneration, %gen0Name 299 298 DEALLOCATE(had, hadv_inca, vad, vadv_inca, conv_flg_inca, pbl_flg_inca, solsym_inca) 300 #endif 299 END IF 301 300 !--------------------------------------------------------------------------------------------------------------------------- 302 301 ELSE !=== OTHER CASES (OLD OR NEW FORMAT, NO INCA MODULE) … … 307 306 nbtr = nqtrue-COUNT(delPhase(tracers(:)%gen0Name) == 'H2O' & 308 307 .AND. tracers(:)%component == 'lmdz') !--- Number of tracers passed to phytrac 309 #ifdef INCA 308 IF (CPPKEY_INCA) THEN 310 309 nqINCA = COUNT(tracers(:)%component == 'inca') 311 #endif 310 END IF 312 311 lerr = getKey('hadv', hadv, ky=tracers(:)%keys) 313 312 lerr = getKey('vadv', vadv, ky=tracers(:)%keys) … … 419 418 CALL msg('niso = '//TRIM(int2str(niso)), modname) 420 419 CALL msg('ntiso = '//TRIM(int2str(ntiso)), modname) 421 #ifdef INCA 422 CALL msg('nqCO2 = '//TRIM(int2str(nqCO2)), modname)423 CALL msg('nqINCA = '//TRIM(int2str(nqINCA)), modname)424 #endif 420 IF (CPPKEY_INCA) THEN 421 CALL msg('nqCO2 = '//TRIM(int2str(nqCO2)), modname) 422 CALL msg('nqINCA = '//TRIM(int2str(nqINCA)), modname) 423 END IF 425 424 t => tracers 426 425 CALL msg('Information stored in infotrac_phy :', modname) -
LMDZ6/branches/Amaury_dev/libf/phylmd/oasis.F90
r4754 r5091 122 122 USE mod_phys_lmdz_mpi_data, ONLY: klon_mpi_para_nb 123 123 use config_ocean_skin_m, only: activate_ocean_skin 124 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA 124 125 125 126 ! Local variables … … 356 357 357 358 358 #ifdef INCA 359 IF (CPPKEY_INCA) THEN 359 360 IF (dms_cycle_cpl .OR. n2o_cycle_cpl) THEN 360 361 CALL init_inca_oasis(inforecv(idr_ocedms:idr_ocen2o)) 361 362 ENDIF 362 #endif 363 END IF 363 364 364 365 !************************************************************************************ -
LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90
r5088 r5091 111 111 112 112 113 #ifdef INCA114 113 USE geometry_mod, ONLY: longitude, latitude, boundslon, boundslat, ind_cell_glo 115 114 USE time_phylmdz_mod, ONLY: ndays 116 115 USE infotrac_phy, ONLY: nqCO2 117 #endif118 116 #ifdef REPROBUS 119 117 USE chem_rep, ONLY: Init_chem_rep_xjour, d_q_rep, d_ql_rep, d_qi_rep, & … … 122 120 USE strataer_emiss_mod, ONLY: strataer_emiss_init 123 121 #endif 124 #if defined INCA || defined REPROBUS125 122 USE time_phylmdz_mod, ONLY: annee_ref, day_ini, day_ref, start_time 126 123 USE vertical_layers_mod, ONLY: aps, bps, ap, bp 127 #endif128 124 129 125 … … 367 363 reffclwc, cldnvi, lcc3d, lcc3dcon, lcc3dstra, icc3dcon, icc3dstra 368 364 USE output_physiqex_mod, ONLY: output_physiqex 365 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA 369 366 370 367 … … 1238 1235 REAL, dimension(klon, klev) :: cldfrarad ! fraction nuageuse 1239 1236 1240 #ifdef INCA1241 1237 REAL :: calday, zxsnow_dummy(klon) 1242 1238 ! set de variables utilisees pour l'initialisation des valeurs provenant de INCA … … 1245 1241 REAL, DIMENSION(klon,klev,naero_grp,nbands) :: init_cginca 1246 1242 REAL, DIMENSION(klon,klev,nbands) :: init_ccminca 1247 #endif1248 1243 REAL, DIMENSION(klon,nbtr) :: init_source 1249 1244 … … 2181 2176 ! 2182 2177 IF (ANY(type_trac == ['inca','inco'])) THEN ! ModThL 2183 #ifdef INCA 2178 IF (CPPKEY_INCA) THEN 2184 2179 CALL VTe(VTphysiq) 2185 2180 CALL VTb(VTinca) … … 2259 2254 CALL VTe(VTinca) 2260 2255 CALL VTb(VTphysiq) 2261 #endif 2256 END IF 2262 2257 ENDIF 2263 2258 ! … … 2636 2631 B=Z2-fac*alog(pplay(i,itroprep(i))) 2637 2632 ttrop(i)= fac*alog(ptrop(i))+B 2638 ! 2633 ! 2639 2634 Z1= 1.e-3 * ( pphi(i,itroprep(i)+1)+pphis(i) ) / gravit 2640 2635 Z2= 1.e-3 * ( pphi(i,itroprep(i)) +pphis(i) ) / gravit … … 4156 4151 4157 4152 IF (ANY(type_trac == ['inca','inco'])) THEN ! ModThL 4158 #ifdef INCA 4153 IF (CPPKEY_INCA) THEN 4159 4154 CALL VTe(VTphysiq) 4160 4155 CALL VTb(VTinca) … … 4209 4204 CALL VTe(VTinca) 4210 4205 CALL VTb(VTphysiq) 4211 #endif 4206 END IF 4212 4207 ENDIF !type_trac = inca or inco 4213 4208 IF (type_trac == 'repr') THEN … … 4500 4495 4501 4496 IF (aerosol_couple.AND.config_inca=='aero') THEN 4502 #ifdef INCA 4497 IF (CPPKEY_INCA) THEN 4503 4498 CALL radlwsw_inca & 4504 4499 (chemistry_couple, kdlon,kflev,dist, rmu0, fract, solaire, & … … 4520 4515 cldtaupirad, & 4521 4516 topswai_aero, solswai_aero) 4522 #endif 4517 END IF 4523 4518 ELSE 4524 4519 ! … … 5505 5500 ! 5506 5501 IF (ANY(type_trac == ['inca','inco'])) THEN 5507 #ifdef INCA 5502 IF (CPPKEY_INCA) THEN 5508 5503 CALL VTe(VTphysiq) 5509 5504 CALL VTb(VTinca) … … 5525 5520 CALL VTe(VTinca) 5526 5521 CALL VTb(VTphysiq) 5527 #endif 5522 END IF 5528 5523 ENDIF 5529 5524 … … 5781 5776 IF (using_xios) THEN 5782 5777 5783 #ifdef INCA 5778 IF (CPPKEY_INCA) THEN 5784 5779 IF (type_trac == 'inca') THEN 5785 5780 IF (is_omp_master .AND. grid_type==unstructured) THEN … … 5787 5782 ENDIF 5788 5783 ENDIF 5789 #endif 5784 END IF 5790 5785 5791 5786 IF (is_omp_master .and. grid_type==unstructured) CALL xios_context_finalize -
LMDZ6/branches/Amaury_dev/libf/phylmd/phytrac_mod.F90
r5087 r5091 1073 1073 1074 1074 ! ********* end old version 1075 ENDIF ! iflag_lscav .EQ. 1, 2, 3 or 41075 ENDIF ! iflag_lscav .EQ. 1, 2, 3 or 4 1076 1076 ! 1077 1077 ENDIF ! lessivage -
LMDZ6/branches/Amaury_dev/libf/phylmd/tracinca_mod.F90
r4500 r5091 62 62 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat 63 63 USE aero_mod, ONLY : naero_grp 64 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA 64 65 IMPLICIT NONE 65 66 … … 145 146 END DO 146 147 147 #ifdef INCA 148 IF (CPPKEY_INCA) THEN 148 149 IF (config_inca == 'aero' .OR. config_inca == 'chem') THEN 149 150 zpmfu(:,:)=pmfu(:,:) … … 159 160 rh,tau_aero,piz_aero,cg_aero, & 160 161 rfname,ccm,lafin) 161 #endif 162 163 164 #ifdef INCA 162 165 163 CALL chemmain (tr_seri, & !mmr 166 164 nstep, & !nstep … … 198 196 nbp_lat, & !ny 199 197 source ) 200 #endif 198 END IF 201 199 202 200 CALL VTe(VTinca) -
LMDZ6/branches/Amaury_dev/libf/phylmdiso/physiq_mod.F90
r5088 r5091 93 93 USE phys_output_var_mod, ONLY : cloudth_sth,cloudth_senv,cloudth_sigmath,cloudth_sigmaenv 94 94 USE phys_output_var_mod, ONLY : cloud_cover_sw, cloud_cover_sw_s2 95 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA 95 96 96 97 … … 111 112 112 113 113 #ifdef INCA114 114 USE geometry_mod, ONLY: longitude, latitude, boundslon, boundslat, ind_cell_glo 115 115 USE time_phylmdz_mod, ONLY: ndays 116 116 USE infotrac_phy, ONLY: nqCO2 117 #endif118 117 #ifdef REPROBUS 119 118 USE chem_rep, ONLY: Init_chem_rep_xjour, d_q_rep, d_ql_rep, d_qi_rep, & … … 122 121 USE strataer_emiss_mod, ONLY: strataer_emiss_init 123 122 #endif 124 #if defined INCA || defined REPROBUS125 123 USE time_phylmdz_mod, ONLY: annee_ref, day_ini, day_ref, start_time 126 124 USE vertical_layers_mod, ONLY: aps, bps, ap, bp 127 #endif128 125 129 126 … … 1343 1340 REAL, dimension(klon, klev) :: cldfrarad ! fraction nuageuse 1344 1341 1345 #ifdef INCA1346 1342 REAL :: calday, zxsnow_dummy(klon) 1347 1343 ! set de variables utilisees pour l'initialisation des valeurs provenant de INCA … … 1350 1346 REAL, DIMENSION(klon,klev,naero_grp,nbands) :: init_cginca 1351 1347 REAL, DIMENSION(klon,klev,nbands) :: init_ccminca 1352 #endif1353 1348 REAL, DIMENSION(klon,nbtr) :: init_source 1354 1349 … … 2341 2336 ! 2342 2337 IF (ANY(type_trac == ['inca','inco'])) THEN ! ModThL 2343 #ifdef INCA 2338 IF (CPPKEY_INCA) THEN 2344 2339 CALL VTe(VTphysiq) 2345 2340 CALL VTb(VTinca) … … 2419 2414 CALL VTe(VTinca) 2420 2415 CALL VTb(VTphysiq) 2421 #endif 2416 END IF 2422 2417 ENDIF 2423 2418 ! … … 2995 2990 B=Z2-fac*alog(pplay(i,itroprep(i))) 2996 2991 ttrop(i)= fac*alog(ptrop(i))+B 2997 ! 2992 ! 2998 2993 Z1= 1.e-3 * ( pphi(i,itroprep(i)+1)+pphis(i) ) / gravit 2999 2994 Z2= 1.e-3 * ( pphi(i,itroprep(i)) +pphis(i) ) / gravit … … 5611 5606 5612 5607 IF (ANY(type_trac == ['inca','inco'])) THEN ! ModThL 5613 #ifdef INCA 5608 IF (CPPKEY_INCA) THEN 5614 5609 CALL VTe(VTphysiq) 5615 5610 CALL VTb(VTinca) … … 5664 5659 CALL VTe(VTinca) 5665 5660 CALL VTb(VTphysiq) 5666 #endif 5661 END IF 5667 5662 ENDIF !type_trac = inca or inco 5668 5663 IF (type_trac == 'repr') THEN … … 5954 5949 5955 5950 IF (aerosol_couple.AND.config_inca=='aero') THEN 5956 #ifdef INCA 5951 IF (CPPKEY_INCA) THEN 5957 5952 CALL radlwsw_inca & 5958 5953 (chemistry_couple, kdlon,kflev,dist, rmu0, fract, solaire, & … … 5974 5969 cldtaupirad, & 5975 5970 topswai_aero, solswai_aero) 5976 #endif 5971 END IF 5977 5972 ELSE 5978 5973 ! … … 7085 7080 ! 7086 7081 IF (ANY(type_trac == ['inca','inco'])) THEN 7087 #ifdef INCA 7082 IF (CPPKEY_INCA) THEN 7088 7083 CALL VTe(VTphysiq) 7089 7084 CALL VTb(VTinca) … … 7105 7100 CALL VTe(VTinca) 7106 7101 CALL VTb(VTphysiq) 7107 #endif 7102 END IF 7108 7103 ENDIF 7109 7104 … … 7412 7407 IF (using_xios) THEN 7413 7408 7414 #ifdef INCA 7409 IF (CPPKEY_INCA) THEN 7415 7410 IF (type_trac == 'inca') THEN 7416 7411 IF (is_omp_master .AND. grid_type==unstructured) THEN … … 7418 7413 ENDIF 7419 7414 ENDIF 7420 #endif 7415 END IF 7421 7416 7422 7417 IF (is_omp_master .and. grid_type==unstructured) CALL xios_context_finalize -
LMDZ6/branches/Amaury_dev/makelmdz_fcm
r5089 r5091 50 50 arch_default_path="arch" 51 51 52 LMDGCM=$( /bin/pwd)52 LMDGCM=$(pwd) 53 53 LIBOGCM=$LMDGCM/libo 54 54 LIBFGCM=$LMDGCM/libf … … 278 278 mkdir .void_dir 279 279 280 if [[ "$arch_defined" = ="TRUE" ]]; then280 if [[ "$arch_defined" = "TRUE" ]]; then 281 281 local i 282 282 for i in "path" "fcm" "env"; do … … 300 300 } 301 301 302 init_vars303 read_cmdline_options "$@"304 init_arch305 306 302 function cpp_keys_and_include_mod_path() { 307 303 ######################################################################## … … 336 332 fi 337 333 338 if [[ "$filtre"= "filtrez" ]]; then334 if [[ $filtre = "filtrez" ]]; then 339 335 FILTRE_PATH=${LIBFGCM}/$filtre 340 336 fi 341 337 342 if [[ "$chimie"= "INCA" ]]; then338 if [[ $chimie = "INCA" ]]; then 343 339 CPP_KEY="$CPP_KEY INCA" 344 340 INCLUDE="$INCLUDE ${INCA_INCDIR}" … … 346 342 fi 347 343 348 if [[ "$isotopes"= "true" ]]; then344 if [[ $isotopes = "true" ]]; then 349 345 CPP_KEY="$CPP_KEY ISO" 350 346 fi 351 347 352 if [[ "$isoverif"= "true" ]]; then348 if [[ $isoverif = "true" ]]; then 353 349 CPP_KEY="$CPP_KEY ISOVERIF" 354 350 fi 355 351 356 if [[ "$diagiso"= "true" ]]; then352 if [[ $diagiso = "true" ]]; then 357 353 CPP_KEY="$CPP_KEY DIAGISO" 358 354 fi 359 355 360 if [[ "$isotrac"= "true" ]]; then356 if [[ $isotrac = "true" ]]; then 361 357 CPP_KEY="$CPP_KEY ISOTRAC" 362 358 fi 363 359 364 if [[ "$couple"!= "false" ]]; then365 if [[ "$couple"= "MPI1" ]]; then360 if [[ $couple != "false" ]]; then 361 if [[ $couple = "MPI1" ]]; then 366 362 CPP_KEY="$CPP_KEY CPP_COUPLE" 367 363 export OASIS_INCDIR=$LMDGCM/../../prism/X64/build/lib/psmile.MPI1 … … 376 372 fi 377 373 378 if [[ "$parallel"= "mpi" ]]; then374 if [[ $parallel = "mpi" ]]; then 379 375 CPP_KEY="$CPP_KEY CPP_PARA CPP_MPI" 380 376 PARA_FFLAGS="%MPI_FFLAGS" 381 377 PARA_LD="%MPI_LD" 382 elif [[ "$parallel"= "omp" ]]; then378 elif [[ $parallel = "omp" ]]; then 383 379 CPP_KEY="$CPP_KEY CPP_PARA CPP_OMP" 384 380 PARA_FFLAGS="%OMP_FFLAGS" 385 381 PARA_LD="%OMP_LD" 386 elif [[ "$parallel"= "mpi_omp" ]]; then382 elif [[ $parallel = "mpi_omp" ]]; then 387 383 CPP_KEY="$CPP_KEY CPP_PARA CPP_MPI CPP_OMP" 388 384 PARA_FFLAGS="%MPI_FFLAGS %OMP_FFLAGS" … … 390 386 fi 391 387 392 if [[ ( "$parallel" = "omp" || "$parallel" = "mpi_omp" ) && "$compil_mod"= "debug" ]]; then388 if [[ ( $parallel = "omp" || $parallel = "mpi_omp" ) && $compil_mod = "debug" ]]; then 393 389 echo "Usually, parallelization with OpenMP requires some optimization." 394 390 echo "We suggest switching to \"-dev\"." 395 391 fi 396 392 397 if [[ "$veget" = "true" || "$veget" = "orchidee1.9" || "$veget"= "orchidee2.0" \398 || "$veget" = "orchidee2.1" || "$veget"= "orchideetrunk" ]]; then393 if [[ $veget = "true" || $veget = "orchidee1.9" || $veget = "orchidee2.0" \ 394 || $veget = "orchidee2.1" || $veget = "orchideetrunk" ]]; then 399 395 echo "doing orchidee" 400 396 #NB: option 'true': for backward compatibility. To be used with ORCHIDEE tag 1.9-1.9.6 … … 404 400 CPP_KEY="$CPP_KEY CPP_VEGET" 405 401 # temporary, for Orchidee versions 1.9.* (before openmp activation) 406 if [[ "$veget" = = "orchidee1.9" ]]; then402 if [[ "$veget" = "orchidee1.9" ]]; then 407 403 CPP_KEY="$CPP_KEY ORCHIDEE_NOOPENMP" 408 404 fi … … 421 417 echo "orchidee lib" 422 418 echo "${LIB}" 423 elif [[ "$veget"!= "false" ]]; then419 elif [[ $veget != "false" ]]; then 424 420 echo "Option -v $veget does not exist" 425 421 echo "Use ./makelmdz_fcm -h for more information" … … 427 423 fi 428 424 429 if [[ "$inlandsis"= "true" ]]; then425 if [[ $inlandsis = "true" ]]; then 430 426 CPP_KEY="$CPP_KEY CPP_INLANDSIS" 431 427 INLANDSIS_PATH="$LIBFGCM/phy${physique}/inlandsis" 432 428 fi 433 429 434 if [[ "$rad"= "rrtm" ]]; then430 if [[ $rad = "rrtm" ]]; then 435 431 CPP_KEY="$CPP_KEY CPP_RRTM" 436 432 RAD_PATH="$LIBFGCM/phy${physique}/rrtm" 437 fi 438 if [[ "$rad" = "ecrad" ]]; then 433 elif [[ $rad = "ecrad" ]]; then 439 434 CPP_KEY="$CPP_KEY CPP_ECRAD" 440 435 RAD_PATH="$LIBFGCM/phy${physique}/ecrad" 441 436 fi 442 437 443 if [[ "$dust"= "true" ]]; then438 if [[ $dust = "true" ]]; then 444 439 CPP_KEY="$CPP_KEY CPP_Dust" 445 440 DUST_PATH="$LIBFGCM/phy${physique}/Dust" 446 441 fi 447 442 448 if [[ "$strataer"= "true" ]]; then443 if [[ $strataer = "true" ]]; then 449 444 CPP_KEY="$CPP_KEY CPP_StratAer" 450 445 STRATAER_PATH="$LIBFGCM/phy${physique}/StratAer" … … 454 449 LIB="$LIB ${NETCDF95_LIBDIR} ${NETCDF95_LIB}" 455 450 456 if [[ $io = ioipsl]]; then451 if [[ $io = "ioipsl" ]]; then 457 452 CPP_KEY="$CPP_KEY CPP_IOIPSL" 458 453 INCLUDE="$INCLUDE ${IOIPSL_INCDIR}" 459 454 LIB="$LIB ${IOIPSL_LIBDIR} ${IOIPSL_LIB}" 460 elif [[ $io = mix ]]; then 461 # For now, xios implies also using ioipsl 455 elif [[ $io = "mix" ]]; then 462 456 CPP_KEY="$CPP_KEY CPP_IOIPSL CPP_XIOS" 463 457 INCLUDE="$INCLUDE ${IOIPSL_INCDIR} ${XIOS_INCDIR}" 464 458 LIB="$LIB ${IOIPSL_LIBDIR} ${IOIPSL_LIB} ${XIOS_LIBDIR} ${XIOS_LIB}" 465 elif [[ $io = xios ]]; then 466 # For now, xios implies also using ioipsl 459 elif [[ $io = "xios" ]]; then 467 460 CPP_KEY="$CPP_KEY CPP_IOIPSL CPP_XIOS CPP_IOIPSL_NO_OUTPUT" 468 461 INCLUDE="$INCLUDE ${IOIPSL_INCDIR} ${XIOS_INCDIR}" … … 470 463 fi 471 464 472 if [[ "$cosp"= "true" ]]; then465 if [[ $cosp = "true" ]]; then 473 466 CPP_KEY="$CPP_KEY CPP_COSP" 474 467 COSP_PATH="$LIBFGCM/phylmd/cosp" 475 468 fi 476 469 477 if [[ "$cosp2"= "true" ]]; then470 if [[ $cosp2 = "true" ]]; then 478 471 CPP_KEY="$CPP_KEY CPP_COSP2" 479 472 COSP_PATH="$LIBFGCM/phylmd/cosp2" 480 473 fi 481 474 482 if [[ "$cospv2"= "true" ]]; then475 if [[ $cospv2 = "true" ]]; then 483 476 CPP_KEY="$CPP_KEY CPP_COSPV2" 484 477 COSP_PATH="$LIBFGCM/phylmd/cospv2" 485 478 fi 486 479 487 if [[ "$cplocninca"= "TRUE" ]]; then480 if [[ $cplocninca = "TRUE" ]]; then 488 481 CPP_KEY="${CPP_KEY} CPP_CPLOCNINCA" 489 482 fi … … 494 487 } 495 488 496 cpp_keys_and_include_mod_path 497 498 499 ######################################################################## 500 # calcul du nombre de dimensions 501 ######################################################################## 502 503 504 dim_full=$dim 505 dim=`echo $dim | sed -e 's/[^0-9]/ /g'` 506 set $dim 507 dimc=$# 508 echo calcul de la dimension 509 echo dim $dim 510 echo dimc $dimc 511 512 513 ######################################################################## 514 # Gestion des dimensions du modele. 515 # on cree ou remplace le fichier des dimensions 516 ######################################################################## 517 518 cd $LIBFGCM/grid 519 if [[ -f dimensions.h ]] 520 then 521 if [[ $force_compile == true ]] 522 then 523 \rm -f $LIBFGCM/grid/dimensions.h 489 function handle_dimension() { 490 ######################################################################## 491 # calcul du nombre de dimensions 492 ######################################################################## 493 494 dim_full=$dim 495 dim=$(echo "$dim" | sed -e 's/[^0-9]/ /g') 496 dimc=$(awk -F" " '{print NF}' <<< "$dim") 497 echo "calcul de la dimension: dim=$dim, dimc=$dimc" 498 499 ######################################################################## 500 # Gestion des dimensions du modele. 501 # on cree ou remplace le fichier des dimensions 502 ######################################################################## 503 504 cd "$LIBFGCM/grid" 505 if [[ -f dimensions.h ]]; then 506 if [[ $force_compile = "true" ]]; then 507 rm -f "$LIBFGCM/grid/dimensions.h" 508 else 509 echo "WARNING: you are probably already compiling the model somewhere else." 510 echo "Wait until the first compilation is finished before launching this one." 511 echo "If you are sure that you are not compiling elsewhere, " 512 echo "If you are sure that you are not compiling elsewhere, then" 513 echo "rm -f \"$LIBFGCM/grid/dimensions.h\"" 514 echo "before reruning the compilation" 515 echo "or run makelmdz_fcm with option -force_compile" 516 exit 1 517 fi 518 fi 519 520 cd "$LIBFGCM/grid/dimension" 521 # shellcheck disable=SC2086 522 ./makdim $dim 523 cat "$LIBFGCM/grid/dimensions.h" 524 cd "$LMDGCM" 525 } 526 527 function different_dynamics() { 528 ######################################################################## 529 # Differentes dynamiques (3d, 2d, 1d) 530 ######################################################################## 531 532 if [[ $dimc = 3 ]]; then 533 cd "$LIBFGCM/grid" 534 rm fxyprim.h 535 cp -p "fxy_${grille}.h" fxyprim.h 536 fi 537 538 if [[ $dimc = 1 ]]; then 539 CPP_KEY="$CPP_KEY CPP_1D" 540 ## no filtre in 1d: 541 FILTRE_PATH="$LMDGCM/.void_dir" 542 ## no need to compile all routines in dyn3d_common either: 543 DYN_COMMON_PATH="$LMDGCM/.void_dir" 544 ## no need to compile all routines in dynlmdz_phy...; 545 ## (because key ones are included in 1D main program) 546 DYN_PHYS_PATH="$LMDGCM/.void_dir" 547 DYN_PHYS_SUB_PATH="$LMDGCM/.void_dir" 548 fi 549 550 ###################################################################### 551 # Gestion du filtre qui n'existe qu'en 3d. 552 ###################################################################### 553 if [[ $dimc -gt 2 ]]; then 554 filtre="FILTRE=$filtre" 555 else 556 filtre="FILTRE= L_FILTRE= " 557 fi 558 echo "MACRO FILTRE $filtre (dimc=$dimc)" 559 } 560 561 function create_config_suffix() { 562 ###################################################################### 563 # Creation du suffixe de la configuration 564 ###################################################################### 565 566 SUFF_NAME=_${dim_full} 567 SUFF_NAME=${SUFF_NAME}_phy${physique}_${rad} 568 569 if [[ $parallel != "none" ]]; then 570 SUFF_NAME=${SUFF_NAME}_para 571 DYN=dyn${dimc}d${paramem} 572 if [[ $paramem = "mem" ]]; then 573 SUFF_NAME=${SUFF_NAME}_${paramem} 524 574 else 525 echo "WARNING: you are probably already compiling the model somewhere else." 526 echo "Wait until the first compilation is finished before launching this one." 527 echo "If you are sure that you are not compiling elsewhere, " 528 echo "If you are sure that you are not compiling elsewhere, then" 529 echo rm -f $LIBFGCM/grid/dimensions.h 530 echo "before reruning the compilation" 531 echo "or run makelmdz_fcm with option -force_compile" 575 echo "The version of the dynamics in dyn3dpar is no longer updated." 576 echo "You should use option \"-mem\"." 532 577 exit 1 533 578 fi 534 fi535 536 537 538 cd $LIBFGCM/grid/dimension539 ./makdim $dim540 cat $LIBFGCM/grid/dimensions.h541 cd $LMDGCM542 543 544 ########################################################################545 # Differentes dynamiques (3d, 2d, 1d)546 ########################################################################547 548 dimension=`echo $dim | wc -w`549 echo dimension $dimension550 551 if (( $dimension == 3 ))552 then553 cd $LIBFGCM/grid554 \rm fxyprim.h555 cp -p fxy_${grille}.h fxyprim.h556 #else557 # echo "Probleme dans les dimensions de la dynamique !!"558 # echo "Non reactive pour l'instant !!!"559 fi560 561 if (( $dimension == 1 ))562 then563 CPP_KEY="$CPP_KEY CPP_1D"564 ## no filtre in 1d:565 FILTRE_PATH=$LMDGCM/.void_dir566 ## no need to compile all routines in dyn3d_common either:567 DYN_COMMON_PATH=$LMDGCM/.void_dir568 ## no need to compile all routines in dynlmdz_phy... ;569 ## (because key ones are included in 1D main program)570 DYN_PHYS_PATH=$LMDGCM/.void_dir571 DYN_PHYS_SUB_PATH=$LMDGCM/.void_dir572 fi573 574 ######################################################################575 # Traitement special pour le nouveau rayonnement de Laurent Li.576 # ---> YM desactive pour le traitemement en parallele577 ######################################################################578 579 #if [[ -f $libf/phy$physique/raddim.h ]]580 #then581 # if [[ -f $libf/phy$physique/raddim.$dimh.h ]]582 #then583 # \rm -f $libf/phy$physique/raddim.h584 # cp -p $libf/phy$physique/raddim.$dimh.h $libf/phy$physique/raddim.h585 # echo $libf/phy$physique/raddim.$dimh.h586 # cat $libf/phy$physique/raddim.h587 # else588 # echo On peut diminuer la taille de l executable en creant589 # echo le fichier $libf/phy$physique/raddim.$dimh.h590 # \cp -p $libf/phy$physique/raddim.defaut.h $libf/phy$physique/raddim.h591 # fi592 #fi593 594 ######################################################################595 # Gestion du filtre qui n'existe qu'en 3d.596 ######################################################################597 598 if (( `expr $dimc \> 2` == 1 ))599 then600 filtre="FILTRE=$filtre"601 else602 filtre="FILTRE= L_FILTRE= "603 fi604 echo MACRO FILTRE $filtre605 606 echo $dimc607 608 609 610 ######################################################################611 # Creation du suffixe de la configuration612 ######################################################################613 614 615 SUFF_NAME=_${dim_full}616 SUFF_NAME=${SUFF_NAME}_phy${physique}_${rad}617 618 if [[ "$parallel" != "none" ]]619 then620 SUFF_NAME=${SUFF_NAME}_para621 DYN=dyn${dimc}d${paramem}622 if [[ "$paramem" == "mem" ]]623 then624 SUFF_NAME=${SUFF_NAME}_${paramem}625 579 else 626 echo "The version of the dynamics in dyn3dpar is no longer updated." 627 echo "You should use option \"-mem\"." 628 exit 1 629 fi 630 else 631 SUFF_NAME=${SUFF_NAME}_seq 632 if (( $dimension == 1 )) 633 then 634 # dynamics-related routines in"dyn1d" subdirectory of phy${physique} 635 DYN=phy${physique}/dyn1d 580 SUFF_NAME=${SUFF_NAME}_seq 581 if [[ $dimc = 1 ]]; then 582 # dynamics-related routines in"dyn1d" subdirectory of phy${physique} 583 DYN=phy${physique}/dyn1d 584 else 585 DYN=dyn${dimc}d 586 fi 587 fi 588 589 if [[ $veget != "false" ]]; then 590 SUFF_NAME=${SUFF_NAME}_orch 591 fi 592 593 if [[ $dust = "true" ]]; then 594 SUFF_NAME=${SUFF_NAME}_spla 595 fi 596 597 if [[ $couple != "false" ]]; then 598 SUFF_NAME=${SUFF_NAME}_couple 599 fi 600 601 if [[ $chimie = "INCA" ]]; then 602 SUFF_NAME=${SUFF_NAME}_inca 603 fi 604 605 if [[ "$isotopes" = "true" ]]; then 606 SUFF_NAME=${SUFF_NAME}_iso 607 fi 608 if [[ "$isoverif" = "true" ]]; then 609 SUFF_NAME=${SUFF_NAME}_isoverif 610 fi 611 if [[ "$isotrac" = "true" ]]; then 612 SUFF_NAME=${SUFF_NAME}_isotrac 613 fi 614 if [[ "$diagiso" = "true" ]]; then 615 SUFF_NAME=${SUFF_NAME}_diagiso 616 fi 617 618 if [[ $libphy = "true" ]]; then 619 # special case where we compile only the physics 620 DYN=$LMDGCM/.void_dir 621 DYN_COMMON_PATH=$LMDGCM/.void_dir 622 FILTRE_PATH=$LMDGCM/.void_dir 623 DYN_PHYS_PATH=$LMDGCM/.void_dir 624 DYN_PHYS_SUB_PATH=$LMDGCM/.void_dir 625 #and there is no main program to generate 626 code="" 627 SUFF_NAME="" 636 628 else 637 DYN=dyn${dimc}d 638 fi 639 fi 640 641 if [[ $veget != "false" ]] 642 then 643 SUFF_NAME=${SUFF_NAME}_orch 644 fi 645 646 if [[ $dust == "true" ]] 647 then 648 SUFF_NAME=${SUFF_NAME}_spla 649 fi 650 651 if [[ $couple != "false" ]] 652 then 653 SUFF_NAME=${SUFF_NAME}_couple 654 fi 655 656 if [[ $chimie == "INCA" ]] 657 then 658 SUFF_NAME=${SUFF_NAME}_inca 659 fi 660 661 if [[ "$isotopes" == "true" ]] 662 then 663 SUFF_NAME=${SUFF_NAME}_iso 664 fi 665 if [[ "$isoverif" == "true" ]] 666 then 667 SUFF_NAME=${SUFF_NAME}_isoverif 668 fi 669 if [[ "$isotrac" == "true" ]] 670 then 671 SUFF_NAME=${SUFF_NAME}_isotrac 672 fi 673 if [[ "$diagiso" == "true" ]] 674 then 675 SUFF_NAME=${SUFF_NAME}_diagiso 676 fi 677 678 if [[ $libphy == "true" ]] 679 then 680 # special case where we compile only the physics 681 DYN=$LMDGCM/.void_dir 682 DYN_COMMON_PATH=$LMDGCM/.void_dir 683 FILTRE_PATH=$LMDGCM/.void_dir 684 DYN_PHYS_PATH=$LMDGCM/.void_dir 685 DYN_PHYS_SUB_PATH=$LMDGCM/.void_dir 686 #and there is no main program to generate 687 code="" 688 SUFF_NAME="" 689 else 690 SUFF_NAME=${SUFF_NAME}.e 691 fi 692 693 cd $LMDGCM 694 config_fcm="config.fcm" 695 rm -f $config_fcm 696 touch $config_fcm 697 rm -f bin/${code}${SUFF_NAME}.e 698 rm -f arch.fcm 699 rm -f arch.opt 700 701 echo "%ARCH $arch" >> $config_fcm 702 echo "%INCDIR $INCLUDE" >> $config_fcm 703 echo "%LIB $LIB" >> $config_fcm 704 echo "%ROOT_PATH $PWD" >> $config_fcm 705 echo "%LIBF $LIBFGCM" >> $config_fcm 706 echo "%LIBO $LIBOGCM" >> $config_fcm 707 echo "%DYN $DYN" >> $config_fcm 708 echo "%DYN_COMMON $DYN_COMMON_PATH" >> $config_fcm 709 echo "%PHY_COMMON $PHY_COMMON_PATH" >> $config_fcm 710 echo "%FILTRE $FILTRE_PATH" >> $config_fcm 711 echo "%PHYS phy${physique}" >> $config_fcm 712 echo "%DYN_PHYS $DYN_PHYS_PATH" >> $config_fcm 713 echo "%DYN_PHYS_SUB $DYN_PHYS_SUB_PATH" >> $config_fcm 714 echo "%RAD $RAD_PATH" >> $config_fcm 715 echo "%DUST $DUST_PATH" >> $config_fcm 716 echo "%STRATAER $STRATAER_PATH" >> $config_fcm 717 echo "%INLANDSIS $INLANDSIS_PATH" >> $config_fcm 718 echo "%COSP $COSP_PATH" >> $config_fcm 719 echo "%CPP_KEY $CPP_KEY" >> $config_fcm 720 echo "%EXEC $code" >> $config_fcm 721 echo "%SUFF_NAME $SUFF_NAME" >> $config_fcm 722 echo "%COMPIL_FFLAGS $COMPIL_FFLAGS" >> $config_fcm 723 echo "%PARA_FFLAGS $PARA_FFLAGS" >> $config_fcm 724 echo "%PARA_LD $PARA_LD" >> $config_fcm 725 echo "%EXT_SRC $EXT_SRC" >> $config_fcm 726 727 if [[ "$rad" == "ecrad" ]] 728 then 729 \cp bld.cfg.ecrad bld.cfg 730 else 731 \cp bld.cfg.rrtm bld.cfg 732 fi 733 734 ln -s arch/arch-${arch}.fcm arch.fcm 735 if test -f arch/arch-${arch}.opt && [ $compil_mod = "prod" ] 736 then 737 ln -s arch/arch-${arch}.opt arch.opt 738 else 739 ln -s .void_file arch.opt 740 fi 741 742 set +e 743 744 rm -f $LIBOGCM/${arch}${SUFF_NAME}/.config/fcm.bld.lock 745 ./build_gcm ${fcm_path} -j $job $full 746 build_status=$? 747 748 rm -rf tmp_src 749 rm -rf config 750 ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config config 751 ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config/ppsrc tmp_src 752 753 if [[ -r $LIBFGCM/grid/dimensions.h ]] 754 then 755 # Cleanup: remove dimension.h file 756 \rm -f $LIBFGCM/grid/dimensions.h 757 fi 758 759 # build netcdf95 library necessary for the makelmdz script 760 if [[ $build_status = 0 ]] 761 then 762 if [[ ! -d tools/netcdf95/include ]] 763 then 764 mkdir tools/netcdf95/include tools/netcdf95/lib 765 cp config/inc/netcdf95.mod config/inc/nf95_*mod tools/netcdf95/include 766 cp config/obj/netcdf95.o config/obj/nf95_*o config/obj/check_start_count_m.o tools/netcdf95/lib 767 cd tools/netcdf95/lib; ar rv libnetcdf95.a *.o; ranlib libnetcdf95.a 768 cd - 769 fi 770 fi 771 772 exit $build_status 629 SUFF_NAME=${SUFF_NAME}.e 630 fi 631 } 632 633 function create_fcm_conf() { 634 cd "$LMDGCM" 635 config_fcm="config.fcm" 636 rm -f "bin/${code}${SUFF_NAME}.e" 637 rm -f arch.fcm 638 rm -f arch.opt 639 640 { 641 echo "%ARCH $arch" 642 echo "%INCDIR $INCLUDE" 643 echo "%LIB $LIB" 644 echo "%ROOT_PATH $PWD" 645 echo "%LIBF $LIBFGCM" 646 echo "%LIBO $LIBOGCM" 647 echo "%DYN $DYN" 648 echo "%DYN_COMMON $DYN_COMMON_PATH" 649 echo "%PHY_COMMON $PHY_COMMON_PATH" 650 echo "%FILTRE $FILTRE_PATH" 651 echo "%PHYS phy${physique}" 652 echo "%DYN_PHYS $DYN_PHYS_PATH" 653 echo "%DYN_PHYS_SUB $DYN_PHYS_SUB_PATH" 654 echo "%RAD $RAD_PATH" 655 echo "%DUST $DUST_PATH" 656 echo "%STRATAER $STRATAER_PATH" 657 echo "%INLANDSIS $INLANDSIS_PATH" 658 echo "%COSP $COSP_PATH" 659 echo "%CPP_KEY $CPP_KEY" 660 echo "%EXEC $code" 661 echo "%SUFF_NAME $SUFF_NAME" 662 echo "%COMPIL_FFLAGS $COMPIL_FFLAGS" 663 echo "%PARA_FFLAGS $PARA_FFLAGS" 664 echo "%PARA_LD $PARA_LD" 665 echo "%EXT_SRC $EXT_SRC" 666 } > $config_fcm 667 668 # ecrad conf 669 if [[ $rad = "ecrad" ]]; then 670 cp bld.cfg.ecrad bld.cfg 671 else 672 cp bld.cfg.rrtm bld.cfg 673 fi 674 675 # arch.fcm and arch.opt 676 ln -s "arch/arch-$arch.fcm" arch.fcm 677 if [[ -f arch/arch-$arch.opt && $compil_mod = "prod" ]]; then 678 ln -s "arch/arch-$arch.opt" arch.opt 679 else 680 ln -s .void_file arch.opt 681 fi 682 } 683 684 function build_gcm() { 685 set +e 686 687 rm -f "$LIBOGCM/$arch$SUFF_NAME/.config/fcm.bld.lock" 688 ./build_gcm "$fcm_path" -j "$job" $full 689 build_status=$? 690 691 rm -rf tmp_src 692 rm -rf config 693 ln -s "$LIBOGCM/$arch$SUFF_NAME/.config" config 694 ln -s "$LIBOGCM/$arch$SUFF_NAME/.config/ppsrc" tmp_src 695 696 if [[ -r $LIBFGCM/grid/dimensions.h ]]; then 697 # Cleanup: remove dimension.h file 698 rm -f "$LIBFGCM/grid/dimensions.h" 699 fi 700 701 # build netcdf95 library necessary for the makelmdz script 702 if [[ $build_status = 0 ]]; then 703 if [[ ! -d tools/netcdf95/include ]]; then 704 mkdir tools/netcdf95/include tools/netcdf95/lib 705 cp config/inc/netcdf95.mod config/inc/nf95_*mod tools/netcdf95/include 706 cp config/obj/netcdf95.o config/obj/nf95_*o config/obj/check_start_count_m.o tools/netcdf95/lib 707 cd tools/netcdf95/lib; ar rv libnetcdf95.a -- *.o; ranlib libnetcdf95.a 708 cd - 709 fi 710 fi 711 712 exit $build_status 713 } 714 715 init_vars 716 read_cmdline_options "$@" 717 init_arch 718 cpp_keys_and_include_mod_path 719 handle_dimension 720 different_dynamics 721 create_config_suffix 722 create_fcm_conf 723 build_gcm
Note: See TracChangeset
for help on using the changeset viewer.