Changeset 4210 for dynamico_lmdz/simple_physics/phyparam
- Timestamp:
- Jan 7, 2020, 10:53:19 AM (5 years ago)
- Location:
- dynamico_lmdz/simple_physics/phyparam/physics
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
dynamico_lmdz/simple_physics/phyparam/physics/astronomy.F90
r4199 r4210 14 14 15 15 SUBROUTINE solarlong(pday,psollong) 16 17 !=======================================================================18 ! Calcul de la distance soleil-planete et de la declinaison19 ! en fonction du jour de l'annee.20 !21 ! Methode:22 ! --------23 ! Calcul complet de l'ellipse24 !25 ! Input:26 ! ------27 ! pday jour de l'annee (le jour 0 correspondant a l'equinoxe)28 ! lwrite clef logique pour sorties de controle29 !30 ! Output:31 ! -------32 ! pdist_sol distance entre le soleil et la planete33 ! ( en unite astronomique pour utiliser la constante34 ! solaire terrestre 1370 Wm-2 )35 ! pdecli declinaison ( en radians )36 !37 !=======================================================================38 39 16 USE planet 40 REAL, INTENT(IN) :: pday 41 REAL, INTENT(OUT) :: psollong 17 REAL, INTENT(IN) :: pday ! jour de l'annee (le jour 0 correspondant a l'equinoxe) 18 REAL, INTENT(OUT) :: psollong ! solar longitude 42 19 LOGICAL, PARAMETER :: lwrite=.TRUE. 43 REAL pdist_sol, pdecli44 20 45 21 ! Local: … … 82 58 83 59 IF (lwrite) THEN 84 WRITELOG(*,*) 'jour de l"annee :',pday 85 WRITELOG(*,*) 'distance au soleil (en unite astronomique) :',pdist_sol 86 WRITELOG(*,*) 'declinaison (en degres) :',pdecli*180./pi 87 LOG_INFO('solarlong') 60 WRITELOG(*,*) 'day of the year :',pday 61 WRITELOG(*,*) 'solar longitude : ',psollong 62 LOG_DBG('solarlong') 88 63 ENDIF 89 64 -
dynamico_lmdz/simple_physics/phyparam/physics/logging.F90
r4206 r4210 25 25 26 26 ! This module provides a default implementation of flush_plugin but the top-level driver is welcome to override it. 27 PROCEDURE(plugin), POINTER :: flush_plugin => default_flush 27 PROCEDURE(plugin), POINTER :: flush_plugin => default_flush_plugin 28 28 29 29 ! The top-level driver MUST provide an implementation for log_gridpoint_plugin 30 30 PROCEDURE(plugin_log_gridpoint), POINTER :: log_gridpoint_plugin => NULL() 31 31 32 INTEGER, PARAMETER :: bufsize=1000033 CHARACTER( bufsize) :: logging_buf(100)32 INTEGER, PARAMETER :: linesize=10000, logging_bufsize=100 33 CHARACTER(linesize) :: logging_buf(logging_bufsize) 34 34 35 35 INTEGER :: logging_lineno=0 36 36 37 INTEGER, PARAMETER, PUBLIC :: log_level_fatal=0, log_level_error=1, log_level_warn=2, log_level_info=3, log_level_dbg=4 37 ! messages with a log level higher > max_log_level are not printed 38 INTEGER, PARAMETER, PUBLIC :: log_level_fatal=1, log_level_error=2, log_level_warn=3, log_level_info=4, log_level_dbg=5 39 INTEGER, PUBLIC :: max_log_level = log_level_info 38 40 39 PUBLIC :: logging_buf, logging_ lineno, flush_log, log_gridpoint, &41 PUBLIC :: logging_buf, logging_bufsize, logging_lineno, flush_log, log_gridpoint, & 40 42 flush_plugin, log_gridpoint_plugin 41 43 … … 45 47 INTEGER, INTENT(IN) :: lev 46 48 CHARACTER(*), INTENT(IN) :: tag 47 CALL flush_plugin(lev, TRIM(tag), logging_buf(1:logging_lineno))49 IF(logging_lineno>0 .AND. lev<=max_log_level) CALL flush_plugin(lev, TRIM(tag), logging_buf(1:logging_lineno)) 48 50 logging_lineno=0 49 51 END SUBROUTINE flush_log 50 52 51 SUBROUTINE default_flush (lev, tag, buf)53 SUBROUTINE default_flush_plugin(lev, tag, buf) 52 54 INTEGER, INTENT(IN) :: lev 53 55 CHARACTER(*), INTENT(IN) :: tag, buf(:) 56 CHARACTER(3), DIMENSION(log_level_dbg) :: dbtag = (/ 'FAT', 'ERR', 'WRN', 'INF', 'DBG' /) 57 CHARACTER(100) :: prefix 54 58 INTEGER :: i 59 WRITE(prefix,*) '[', dbtag(lev), ' ', tag, ']' 55 60 DO i=1, SIZE(buf) 56 PRINT *, '[INFO ',tag,']', TRIM(buf(i))61 PRINT *, TRIM(prefix), TRIM(buf(i)) 57 62 END DO 58 END SUBROUTINE default_flush 63 END SUBROUTINE default_flush_plugin 59 64 60 65 SUBROUTINE log_gridpoint(index) -
dynamico_lmdz/simple_physics/phyparam/physics/radiative_sw.F90
r4205 r4210 1 1 MODULE radiative_sw 2 3 #include "use_logging.h" 4 2 5 IMPLICIT NONE 3 6 SAVE … … 135 138 IF (lwrite) THEN 136 139 igout=ncount/2+1 137 PRINT*138 PRINT*,'Diagnostique des transmission dans le spectre solaire'139 PRINT*,'zfract, zmu, zalb'140 PRINT*,zfract(igout), zmu(igout), zalb(igout)141 PRINT*,'Pression, quantite d abs, transmission'140 WRITELOG(*,*) 141 WRITELOG(*,*) 'Diagnostique des transmission dans le spectre solaire' 142 WRITELOG(*,*) 'zfract, zmu, zalb' 143 WRITELOG(*,*) zfract(igout), zmu(igout), zalb(igout) 144 WRITELOG(*,*) 'Pression, quantite d abs, transmission' 142 145 DO l=1,nlayer+1 143 PRINT*,zplev(igout,l),zu(igout,l),ztrdir(igout,l)146 WRITELOG(*,*) zplev(igout,l),zu(igout,l),ztrdir(igout,l) 144 147 ENDDO 145 148 ENDIF … … 157 160 ENDDO 158 161 IF (lwrite) THEN 159 PRINT*160 PRINT*,'Diagnostique des taux de chauffage solaires:'161 PRINT*,' 1 taux de chauffage lie au ray. solaire direct'162 WRITELOG(*,*) 163 WRITELOG(*,*) 'Diagnostique des taux de chauffage solaires:' 164 WRITELOG(*,*) ' 1 taux de chauffage lie au ray. solaire direct' 162 165 DO l=1,nlayer 163 PRINT*,zdtsw(igout,l)166 WRITELOG(*,*) zdtsw(igout,l) 164 167 ENDDO 165 168 ENDIF … … 176 179 ENDDO 177 180 IF (lwrite) THEN 178 PRINT*179 PRINT*,'Diagnostique des taux de chauffage solaires:'180 PRINT*,' 2 flux solaire net incident sur le sol'181 PRINT*,zflux(igout)181 WRITELOG(*,*) 182 WRITELOG(*,*) 'Diagnostique des taux de chauffage solaires:' 183 WRITELOG(*,*) ' 2 flux solaire net incident sur le sol' 184 WRITELOG(*,*) zflux(igout) 182 185 ENDIF 183 186 … … 194 197 195 198 IF (lwrite) THEN 196 PRINT*197 PRINT*,'Diagnostique des taux de chauffage solaires'198 PRINT*,' 3 transmission avec les sol'199 PRINT*,'niveau transmission'199 WRITELOG(*,*) 200 WRITELOG(*,*) 'Diagnostique des taux de chauffage solaires' 201 WRITELOG(*,*) ' 3 transmission avec les sol' 202 WRITELOG(*,*) 'niveau transmission' 200 203 DO l=1,nlevel 201 PRINT*,l,ztrref(igout,l)204 WRITELOG(*,*) l,ztrref(igout,l) 202 205 ENDDO 203 206 ENDIF … … 220 223 221 224 IF (lwrite) THEN 222 PRINT*223 PRINT*,'Diagnostique des taux de chauffage solaires:'224 PRINT*,' 3 taux de chauffage total'225 WRITELOG(*,*) 226 WRITELOG(*,*) 'Diagnostique des taux de chauffage solaires:' 227 WRITELOG(*,*) ' 3 taux de chauffage total' 225 228 DO l=1,nlayer 226 PRINT*,zdtsw(igout,l)229 WRITELOG(*,*) zdtsw(igout,l) 227 230 ENDDO 228 231 ENDIF … … 236 239 ENDDO 237 240 ELSE 238 print*,'NOT DIURNE'241 WRITELOG(*,*) 'NOT DIURNE' 239 242 fsrfvis(:)=zflux(:) 240 243 dtsw(:,:)=zdtsw(:,:) … … 247 250 ! call dump2d(iim,jjm-1,albedo(2),'albedo ') 248 251 ! call dump2d(iim,jjm-1,ztrdir(2,1),'ztrdir ') 249 252 LOG_INFO('rad_sw') 250 253 251 254 END SUBROUTINE sw -
dynamico_lmdz/simple_physics/phyparam/physics/solar.F90
r4201 r4210 1 1 MODULE solar 2 3 #include "use_logging.h" 4 2 5 IMPLICIT NONE 3 4 6 PRIVATE 5 7 … … 143 145 ! 144 146 ! incl=R_incl * pi_local / 180. 145 print*,'Obliquite =' ,obliquit 147 WRITELOG(*,*) 'Obliquite =' ,obliquit 148 LOG_INFO('solar') 149 146 150 incl=obliquit * pi_local / 180. 147 151 ! … … 303 307 !----------------------------------------------------------------------- 304 308 305 ! print*,'npts,pdeclin',npts,pdeclin306 309 z = pdeclin 307 310 cz = cos (z) 308 311 sz = sin (z) 309 ! print*,'cz,sz',cz,sz310 312 311 313 DO j = 1, npts -
dynamico_lmdz/simple_physics/phyparam/physics/surface.F90
r4208 r4210 1 1 MODULE surface 2 3 #include "use_logging.h" 4 2 5 IMPLICIT NONE 3 6 PRIVATE … … 34 37 ! -------------------------------------------------------- 35 38 36 print*,'nsoil,ngrid,firstcall=',nsoil,ngrid, .TRUE. 39 WRITELOG(*,*) 'nsoil,ngrid,firstcall=',nsoil,ngrid, .TRUE. 40 37 41 ALLOCATE(dz1(nsoil),dz2(nsoil)) 38 42 ALLOCATE(zc(ngrid,nsoil),zd(ngrid,nsoil)) … … 55 59 ENDDO 56 60 lambda=fz(.5)*dz1(1) 57 PRINT*,'full layers, intermediate layers (secoonds)'61 WRITELOG(*,*) 'full layers, intermediate layers (secoonds)' 58 62 DO jk=1,nsoil 59 63 rk=jk 60 64 rk1=jk+.5 61 65 rk2=jk-.5 62 PRINT*,fz(rk1)*fz(rk2)*pi, & 63 & fz(rk)*fz(rk)*pi 64 ENDDO 65 66 WRITELOG(*,*) fz(rk1)*fz(rk2)*pi, & 67 & fz(rk)*fz(rk)*pi 68 ENDDO 69 70 LOG_INFO('init_soil') 66 71 END SUBROUTINE init_soil 67 72 … … 132 137 REAL zdz2(nsoil),z1(ngrid) 133 138 134 print*,'firstcall soil ',firstcall135 139 IF (firstcall) THEN 136 140 CALL init_soil(ngrid, nsoil) -
dynamico_lmdz/simple_physics/phyparam/physics/turbulence.F90
r4202 r4210 137 137 ENDIF 138 138 pkh(ig,il)=pkv(ig,il) 139 ! IF(ig.EQ.ngrid/2+1) PRINT*,il,lmix,pkv(ig,il),140 ! s zdu,zdv,zdz,zdvodz2,ph(ig,il)+ph(ig,il-1),141 ! s lmix*lmix*zdvodz2*(1-zri/.4),emin_turb,zri,ph(ig,il)-ph(ig,il-1),142 ! s ph(ig,il),ph(ig,il-1)143 139 ENDDO 144 140 ENDDO … … 290 286 ENDDO 291 287 292 IF(lwrite) THEN 293 288 IF(lwrite) THEN 294 289 WRITELOG(*,*) 'Diagnostique diffusion verticale' 295 290 WRITELOG(*,*) 'LMIXMIN',lmixmin 296 PRINT*,'coefficients Cd pour v et h'297 PRINT*,zcdv(ngrid/2+1),zcdh(ngrid/2+1)298 PRINT*,'coefficients K pour v et h'291 WRITELOG(*,*) 'coefficients Cd pour v et h' 292 WRITELOG(*,*) zcdv(ngrid/2+1),zcdh(ngrid/2+1) 293 WRITELOG(*,*) ,'coefficients K pour v et h' 299 294 DO ilev=1,nlay 300 PRINT*,zkv(ngrid/2+1,ilev),zkh(ngrid/2+1,ilev)295 WRITELOG(*,*) zkv(ngrid/2+1,ilev),zkh(ngrid/2+1,ilev) 301 296 ENDDO 302 297 LOG_DBG('vdif') … … 433 428 434 429 IF(lwrite) THEN 435 PRINT*436 PRINT*,'Diagnostique de la diffusion verticale'437 PRINT*,'h avant et apres diffusion verticale'438 PRINT*,ptsrf(ngrid/2+1),ztsrf2(ngrid/2+1)430 WRITELOG(*,*) 431 WRITELOG(*,*) ,'Diagnostique de la diffusion verticale' 432 WRITELOG(*,*) ,'h avant et apres diffusion verticale' 433 WRITELOG(*,*) ,ptsrf(ngrid/2+1),ztsrf2(ngrid/2+1) 439 434 DO ilev=1,nlay 440 PRINT*,ph(ngrid/2+1,ilev),zh(ngrid/2+1,ilev) 441 ENDDO 435 WRITELOG(*,*) ph(ngrid/2+1,ilev),zh(ngrid/2+1,ilev) 436 ENDDO 437 LOG_DBG('vdif') 442 438 END IF 443 439 -
dynamico_lmdz/simple_physics/phyparam/physics/use_logging.h
r4206 r4210 1 1 USE logging 2 #define WRITELOG(junk, fmt) logging_lineno = logging_lineno+1; WRITE(logging_buf(logging_lineno), fmt)2 #define WRITELOG(junk, fmt) logging_lineno = MIN(logging_bufsize, logging_lineno+1) ; WRITE(logging_buf(logging_lineno), fmt) 3 3 #define LOG_WARN(tag) CALL flush_log(log_level_warn, tag) 4 4 #define LOG_INFO(tag) CALL flush_log(log_level_info, tag)
Note: See TracChangeset
for help on using the changeset viewer.