Changeset 2331
- Timestamp:
- Jul 17, 2015, 2:17:02 PM (9 years ago)
- Location:
- LMDZ5/trunk/libf/dynlonlat_phylonlat/phylmd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/dynlonlat_phylonlat/phylmd/ce0l.F90
r2293 r2331 1 1 PROGRAM ce0l 2 ! 3 !------------------------------------------------------------------------------- 4 ! Purpose: Calls etat0, creates initial states and limit_netcdf 5 ! 6 ! interbar=.T. for barycentric interpolation inter_barxy 7 ! extrap =.T. for data extrapolation, like for the SSTs when file does not 8 ! contain ocean points only. 9 ! oldice =.T. for old-style ice, obtained using grille_m (grid_atob). 10 ! masque is created in etat0, passed to limit to ensure consistancy. 11 !------------------------------------------------------------------------------- 12 USE control_mod 13 14 !#ifdef CPP_EARTH 15 !! This prog. is designed to work for Earth 16 USE etat0dyn 2 ! 3 ! Purpose: Calls etat0, creates initial states and limit_netcdf 4 ! 5 ! interbar=.T. for barycentric interpolation inter_barxy 6 ! extrap =.T. for data extrapolation, like for the SSTs when file does not 7 ! contain ocean points only. 8 ! oldice =.T. for old-style ice, obtained using grille_m (grid_atob). 9 ! masque is created in etat0, passed to limit to ensure consistancy. 10 11 USE control_mod, only: DAY_STEP, DAYREF, NSPLIT_PHYS 12 USE etat0dyn, only: etat0dyn_netcdf 17 13 USE netcdf, ONLY: NF90_OPEN, NF90_NOWRITE, NF90_CLOSE, NF90_NOERR 18 14 USE ioipsl, ONLY: ioconf_calendar, getin, flininfo, flinopen, flinget, flinclo 19 15 20 #ifdef CPP_PHYS 21 USE etat0phys 22 USE dimphy 23 USE comgeomphy 24 USE infotrac 25 USE indice_sol_mod 16 USE etat0phys, only: etat0phys_netcdf 17 USE dimphy, only: KLON 18 USE infotrac, only: TYPE_TRAC, infotrac_init 26 19 USE test_disvert_m, ONLY: test_disvert 27 #endif28 ! of #ifdef CPP_PHYS29 30 !#endif31 !! of #ifdef CPP_EARTH32 20 33 21 IMPLICIT NONE 34 22 35 !------------------------------------------------------------------------------- 36 ! Local variables: 37 !#ifndef CPP_EARTH 38 ! include "iniprint.h" 39 !!------------------------------------------------------------------------------- 40 ! WRITE(lunout,*)'ce0l: Earth-specific routine, needs Earth physics' 41 !#else 23 ! Local variables: 42 24 include "dimensions.h" 43 25 include "paramet.h" 26 include "comgeom.h" 44 27 include "comconst.h" 45 28 include "comvert.h" … … 47 30 include "temps.h" 48 31 include "logic.h" 49 REAL :: masque(iip1, jjp1) !--- CONTINENTAL MASK50 REAL :: phis (iip1, jjp1) !--- GROUND GEOPOTENTIAL32 REAL :: masque(iip1, jjp1) !--- CONTINENTAL MASK 33 REAL :: phis (iip1, jjp1) !--- GROUND GEOPOTENTIAL 51 34 CHARACTER(LEN=256) :: modname, fmt, calnd !--- CALENDAR TYPE 52 35 LOGICAL :: use_filtre_fft 53 36 LOGICAL, PARAMETER :: interbar=.TRUE., extrap=.FALSE., oldice=.FALSE. 54 37 55 !--- Local variables for ocean mask reading:38 !--- Local variables for ocean mask reading: 56 39 INTEGER :: nid_o2a, iml_omask, jml_omask, j 57 40 INTEGER :: fid, iret, llm_tmp, ttm_tmp, itaul(1) 58 REAL, ALLOCATABLE :: lon_omask(:, :), dlon_omask(:), ocemask(:,:)59 REAL, ALLOCATABLE :: lat_omask(:, :), dlat_omask(:), ocetmp (:,:)41 REAL, ALLOCATABLE :: lon_omask(:, :), dlon_omask(:), ocemask(:, :) 42 REAL, ALLOCATABLE :: lat_omask(:, :), dlat_omask(:), ocetmp (:, :) 60 43 REAL :: date, lev(1) 61 !------------------------------------------------------------------------------- 44 45 !---------------------------------------------------------------------- 62 46 modname="ce0l" 63 47 64 !--- Constants48 !--- Constants 65 49 pi = 4. * ATAN(1.) 66 50 rad = 6371229. … … 76 60 CALL conf_gcm( 99, .TRUE. ) 77 61 78 dtvr = daysec/ FLOAT(day_step)79 WRITE(lunout, *)'dtvr',dtvr62 dtvr = daysec/REAL(day_step) 63 WRITE(lunout, *)'dtvr', dtvr 80 64 81 65 CALL iniconst() 82 #ifdef CPP_PHYS83 IF(pressure_exner) CALL test_disvert84 #endif85 66 CALL inigeom() 86 67 … … 88 69 calnd='gregorian' 89 70 SELECT CASE(calend) 90 CASE('earth_360d');CALL ioconf_calendar('360d'); calnd='with 360 days/year' 91 CASE('earth_365d');CALL ioconf_calendar('noleap'); calnd='with no leap year' 92 CASE('earth_366d');CALL ioconf_calendar('366d'); calnd='with leap years only' 93 CASE('gregorian'); CALL ioconf_calendar('gregorian') 94 CASE('standard'); CALL ioconf_calendar('gregorian') 95 CASE('julian'); CALL ioconf_calendar('julian'); calnd='julian' 96 CASE('proleptic_gregorian'); CALL ioconf_calendar('gregorian') 97 !--- DC Bof... => IOIPSL a mettre a jour: proleptic_gregorian /= gregorian 98 CASE DEFAULT 99 CALL abort_gcm('ce0l','Bad choice for calendar',1) 71 CASE('earth_360d') 72 CALL ioconf_calendar('360d') 73 calnd='with 360 days/year' 74 CASE('earth_365d') 75 CALL ioconf_calendar('noleap') 76 calnd='with no leap year' 77 CASE('earth_366d') 78 CALL ioconf_calendar('366d') 79 calnd='with leap years only' 80 CASE('gregorian') 81 CALL ioconf_calendar('gregorian') 82 CASE('standard') 83 CALL ioconf_calendar('gregorian') 84 CASE('julian') 85 CALL ioconf_calendar('julian') 86 calnd='julian' 87 CASE('proleptic_gregorian') 88 CALL ioconf_calendar('gregorian') 89 !--- DC Bof... => IOIPSL a mettre a jour: proleptic_gregorian /= gregorian 90 CASE DEFAULT 91 CALL abort_gcm('ce0l', 'Bad choice for calendar', 1) 100 92 END SELECT 101 WRITE(lunout, *)'CHOSEN CALENDAR: Earth '//TRIM(calnd)93 WRITE(lunout, *)'CHOSEN CALENDAR: Earth '//TRIM(calnd) 102 94 #endif 103 95 104 96 use_filtre_fft=.FALSE. 105 CALL getin('use_filtre_fft', use_filtre_fft)97 CALL getin('use_filtre_fft', use_filtre_fft) 106 98 IF(use_filtre_fft) THEN 107 WRITE(lunout, *)"FFT filter not available for sequential dynamics."108 WRITE(lunout, *)"Your setting of variable use_filtre_fft is not used."99 WRITE(lunout, *)"FFT filter not available for sequential dynamics." 100 WRITE(lunout, *)"Your setting of variable use_filtre_fft is not used." 109 101 ENDIF 110 102 111 !--- LAND MASK. TWO CASES:112 ! 1) read from ocean model file "o2a.nc" (coupled runs)113 ! 2) computed from topography file "Relief.nc" (masque(:,:)=-99999.)114 ! Coupled simulations (case 1) use the ocean model mask to compute the115 ! weights to ensure ocean fractions are the same for atmosphere and ocean.116 !******************************************************************************* 103 !--- LAND MASK. TWO CASES: 104 ! 1) read from ocean model file "o2a.nc" (coupled runs) 105 ! 2) computed from topography file "Relief.nc" (masque(:, :)=-99999.) 106 ! Coupled simulations (case 1) use the ocean model mask to compute the 107 ! weights to ensure ocean fractions are the same for atmosphere and ocean. 108 117 109 IF(NF90_OPEN("o2a.nc", NF90_NOWRITE, nid_o2a)/=NF90_NOERR) THEN 118 WRITE(lunout,*)'BEWARE !! No ocean mask "o2a.nc" file found'119 WRITE(lunout,*)'Forced run.'120 masque(:,:)=-99999.110 WRITE(lunout, *)'BEWARE !! No ocean mask "o2a.nc" file found' 111 WRITE(lunout, *)'Forced run.' 112 masque(:, :)=-99999. 121 113 ELSE 122 iret=NF90_CLOSE(nid_o2a) 123 WRITE(lunout,*)'BEWARE !! Ocean mask "o2a.nc" file found' 124 WRITE(lunout,*)'Coupled run.' 125 CALL flininfo("o2a.nc", iml_omask, jml_omask, llm_tmp, ttm_tmp, nid_o2a) 126 IF(iml_omask/=iim .OR.jml_omask/=jjp1) THEN 127 WRITE(lunout,*)'Mismatching dimensions for ocean mask' 128 WRITE(lunout,*)'iim = ',iim ,' iml_omask = ',iml_omask 129 WRITE(lunout,*)'jjp1 = ',jjp1,' jml_omask = ',jml_omask 130 CALL abort_gcm(modname,'',1) 131 END IF 132 ALLOCATE(ocemask(iim,jjp1),lon_omask(iim,jjp1),dlon_omask(iim )) 133 ALLOCATE(ocetmp (iim,jjp1),lat_omask(iim,jjp1),dlat_omask(jjp1)) 134 CALL flinopen("o2a.nc", .FALSE.,iim,jjp1,llm_tmp,lon_omask,lat_omask,lev, & 135 & ttm_tmp,itaul,date,dt,fid) 136 CALL flinget(fid, "OceMask", iim,jjp1,llm_tmp,ttm_tmp,1,1,ocetmp) 137 CALL flinclo(fid) 138 dlon_omask(1:iim ) = lon_omask(1:iim,1) 139 dlat_omask(1:jjp1) = lat_omask(1,1:jjp1) 140 ocemask = ocetmp 141 IF(dlat_omask(1)<dlat_omask(jml_omask)) THEN 142 DO j=1,jjp1; ocemask(:,j) = ocetmp(:,jjp1-j+1); END DO 143 END IF 144 DEALLOCATE(ocetmp,lon_omask,lat_omask,dlon_omask,dlat_omask) 145 IF(prt_level>=1) THEN 146 WRITE(fmt,"(i4,'i1)')")iim ; fmt='('//ADJUSTL(fmt) 147 WRITE(lunout,*)'OCEAN MASK :' 148 WRITE(lunout,fmt) NINT(ocemask) 149 END IF 150 masque(1:iim,:)=1.-ocemask(:,:) 151 masque(iip1 ,:)=masque(1,:) 152 DEALLOCATE(ocemask) 153 END IF 154 phis(:,:)=-99999. 155 156 #ifdef CPP_PHYS 157 CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/)) 158 WRITE(lunout,*)'---> klon=',klon 159 CALL InitComgeomphy 114 iret=NF90_CLOSE(nid_o2a) 115 WRITE(lunout, *)'BEWARE !! Ocean mask "o2a.nc" file found' 116 WRITE(lunout, *)'Coupled run.' 117 CALL flininfo("o2a.nc", iml_omask, jml_omask, llm_tmp, ttm_tmp, nid_o2a) 118 IF(iml_omask/=iim .OR.jml_omask/=jjp1) THEN 119 WRITE(lunout, *)'Mismatching dimensions for ocean mask' 120 WRITE(lunout, *)'iim = ', iim , ' iml_omask = ', iml_omask 121 WRITE(lunout, *)'jjp1 = ', jjp1, ' jml_omask = ', jml_omask 122 CALL abort_gcm(modname, '', 1) 123 END IF 124 ALLOCATE(ocemask(iim, jjp1), lon_omask(iim, jjp1), dlon_omask(iim )) 125 ALLOCATE(ocetmp (iim, jjp1), lat_omask(iim, jjp1), dlat_omask(jjp1)) 126 CALL flinopen("o2a.nc", .FALSE., iim, jjp1, llm_tmp, lon_omask, & 127 lat_omask, lev, ttm_tmp, itaul, date, dt, fid) 128 CALL flinget(fid, "OceMask", iim, jjp1, llm_tmp, ttm_tmp, 1, 1, ocetmp) 129 CALL flinclo(fid) 130 dlon_omask(1:iim ) = lon_omask(1:iim, 1) 131 dlat_omask(1:jjp1) = lat_omask(1, 1:jjp1) 132 ocemask = ocetmp 133 IF(dlat_omask(1)<dlat_omask(jml_omask)) THEN 134 DO j=1, jjp1 135 ocemask(:, j) = ocetmp(:, jjp1-j+1) 136 END DO 137 END IF 138 DEALLOCATE(ocetmp, lon_omask, lat_omask, dlon_omask, dlat_omask) 139 IF(prt_level>=1) THEN 140 WRITE(fmt, "(i4, 'i1)')")iim 141 fmt='('//ADJUSTL(fmt) 142 WRITE(lunout, *)'OCEAN MASK :' 143 WRITE(lunout, fmt) NINT(ocemask) 144 END IF 145 masque(1:iim, :)=1.-ocemask(:, :) 146 masque(iip1 , :)=masque(1, :) 147 DEALLOCATE(ocemask) 148 END IF 149 phis(:, :)=-99999. 150 151 CALL Init_Phys_lmdz(iim, jjp1, llm, 1, (/(jjm-1)*iim+2/)) 152 WRITE(lunout, *)'---> klon=', klon 153 154 call infotrac_init 155 CALL iniphysiq(iim, jjm, llm, daysec, dayref, dtphys / nsplit_phys, rlatu, & 156 rlonv, aire, cu, cv, rad, g, r, cpp, iflag_phys) 157 158 IF(pressure_exner) CALL test_disvert 160 159 161 160 IF (type_trac == 'inca') THEN 162 161 #ifdef INCA 163 CALL init_const_lmdz(nbtr,anneeref,dayref,iphysiq,day_step,nday)164 CALL init_inca_para(iim,jjm+1,klon,1,klon_mpi_para_nb,0)165 WRITE(lunout,*)'nbtr =' , nbtr162 CALL init_const_lmdz(nbtr, anneeref, dayref, iphysiq, day_step, nday) 163 CALL init_inca_para(iim, jjm+1, klon, 1, klon_mpi_para_nb, 0) 164 WRITE(lunout, *)'nbtr =' , nbtr 166 165 #endif 167 ! of #ifdef INCA168 166 END IF 169 167 IF(ok_etat0) THEN 170 WRITE(lunout,'(//)') 171 WRITE(lunout,*) ' ************************ ' 172 WRITE(lunout,*) ' *** etat0phy_netcdf *** ' 173 WRITE(lunout,*) ' ************************ ' 174 WRITE(lunout,'(//)') 175 WRITE(lunout,*) ' interbar = ',interbar 176 CALL etat0phys_netcdf(interbar,masque,phis) 177 END IF 178 #endif 179 ! of #ifdef CPP_PHYS 168 WRITE(lunout, '(//)') 169 WRITE(lunout, *) ' ************************ ' 170 WRITE(lunout, *) ' *** etat0phy_netcdf *** ' 171 WRITE(lunout, *) ' ************************ ' 172 WRITE(lunout, '(//)') 173 WRITE(lunout, *) ' interbar = ', interbar 174 CALL etat0phys_netcdf(interbar, masque, phis) 175 END IF 180 176 181 177 IF(ok_etat0) THEN 182 WRITE(lunout,'(//)') 183 WRITE(lunout,*) ' ************************ ' 184 WRITE(lunout,*) ' *** etat0dyn_netcdf *** ' 185 WRITE(lunout,*) ' ************************ ' 186 WRITE(lunout,'(//)') 187 WRITE(lunout,*) ' interbar = ',interbar 188 CALL etat0dyn_netcdf(interbar,masque,phis) 189 END IF 190 191 #ifdef CPP_PHYS 178 WRITE(lunout, '(//)') 179 WRITE(lunout, *) ' ************************ ' 180 WRITE(lunout, *) ' *** etat0dyn_netcdf *** ' 181 WRITE(lunout, *) ' ************************ ' 182 WRITE(lunout, '(//)') 183 WRITE(lunout, *) ' interbar = ', interbar 184 CALL etat0dyn_netcdf(interbar, masque, phis) 185 END IF 186 192 187 IF(ok_limit) THEN 193 WRITE(lunout,'(//)') 194 WRITE(lunout,*) ' ********************* ' 195 WRITE(lunout,*) ' *** Limit_netcdf *** ' 196 WRITE(lunout,*) ' ********************* ' 197 WRITE(lunout,'(//)') 198 CALL limit_netcdf(interbar,extrap,oldice,masque) 199 END IF 200 #endif 201 202 WRITE(lunout,'(//)') 203 WRITE(lunout,*) ' *************************** ' 204 WRITE(lunout,*) ' *** grilles_gcm_netcdf *** ' 205 WRITE(lunout,*) ' *************************** ' 206 WRITE(lunout,'(//)') 207 CALL grilles_gcm_netcdf_sub(masque,phis) 208 209 !#endif 210 ! of #ifndef CPP_EARTH #else 188 WRITE(lunout, '(//)') 189 WRITE(lunout, *) ' ********************* ' 190 WRITE(lunout, *) ' *** Limit_netcdf *** ' 191 WRITE(lunout, *) ' ********************* ' 192 WRITE(lunout, '(//)') 193 CALL limit_netcdf(interbar, extrap, oldice, masque) 194 END IF 195 196 WRITE(lunout, '(//)') 197 WRITE(lunout, *) ' *************************** ' 198 WRITE(lunout, *) ' *** grilles_gcm_netcdf *** ' 199 WRITE(lunout, *) ' *************************** ' 200 WRITE(lunout, '(//)') 201 CALL grilles_gcm_netcdf_sub(masque, phis) 211 202 212 203 END PROGRAM ce0l 213 !214 !------------------------------------------------------------------------------- -
LMDZ5/trunk/libf/dynlonlat_phylonlat/phylmd/etat0dyn_netcdf.F90
r2302 r2331 83 83 USE exner_hyb_m, ONLY: exner_hyb 84 84 USE exner_milieu_m, ONLY: exner_milieu 85 USE infotrac 85 USE infotrac, only: NQTOT, TNAME 86 86 USE filtreg_mod 87 87 IMPLICIT NONE … … 113 113 ! Initializations for tracers and filter 114 114 !******************************************************************************* 115 CALL infotrac_init116 115 CALL inifilr() 117 116 -
LMDZ5/trunk/libf/dynlonlat_phylonlat/phylmd/iniphysiq.F90
r2320 r2331 75 75 76 76 IF (nlayer/=klev) THEN 77 WRITE (lunout, *) 'STOP in ', trim(modname)78 WRITE (lunout, *) 'Problem with dimensions :'79 77 WRITE (lunout, *) 'nlayer = ', nlayer 80 78 WRITE (lunout, *) 'klev = ', klev 81 abort_message = '' 82 CALL abort_gcm(modname, abort_message, 1) 79 CALL abort_gcm(modname, 'Problem with dimensions', 1) 83 80 END IF 84 81
Note: See TracChangeset
for help on using the changeset viewer.