Changeset 996 for LMDZ4/trunk/libf/phylmd
- Timestamp:
- Sep 9, 2008, 3:22:23 PM (16 years ago)
- Location:
- LMDZ4/trunk/libf/phylmd
- Files:
-
- 4 added
- 1 deleted
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/trunk/libf/phylmd/calcul_divers.h
r776 r996 12 12 c surface terre 13 13 DO i=1, klon 14 IF(pctsrf _new(i,is_ter).GT.0.) THEN15 paire_ter(i)=airephy(i)*pctsrf _new(i,is_ter)14 IF(pctsrf(i,is_ter).GT.0.) THEN 15 paire_ter(i)=airephy(i)*pctsrf(i,is_ter) 16 16 ENDIF 17 17 ENDDO -
LMDZ4/trunk/libf/phylmd/clesphys.h
r900 r996 47 47 REAL freq_ISCCP, ecrit_ISCCP 48 48 INTEGER :: ip_ebil_phy 49 LOGICAL ok_slab_sicOBS50 49 51 50 COMMON/clesphys/cycle_diurne, soil_model, new_oliq, & … … 61 60 & , ecrit_mth, ecrit_tra, ecrit_reg & 62 61 & , freq_ISCCP, ecrit_ISCCP, ip_ebil_phy & 63 & , ok_ slab_sicOBS, ok_lic_melt, cvl_corr&62 & , ok_lic_melt, cvl_corr & 64 63 & , qsol0 65 64 -
LMDZ4/trunk/libf/phylmd/climb_hq_mod.F90
r793 r996 1 ! 2 ! $Header$ 3 ! 1 4 MODULE climb_hq_mod 2 5 ! … … 274 277 REAL, DIMENSION(klon,klev) :: h_new, q_new 275 278 REAL, DIMENSION(klon) :: psref 276 INTEGER :: k, i 279 INTEGER :: k, i, ierr 277 280 278 281 !**************************************************************************************** … … 350 353 ! 351 354 !**************************************************************************************** 352 DEALLOCATE(Ccoef_Q, Dcoef_Q, Ccoef_H, Dcoef_H) 353 DEALLOCATE(gamaq, gamah) 354 DEALLOCATE(Kcoefhq) 355 355 DEALLOCATE(Ccoef_Q, Dcoef_Q, Ccoef_H, Dcoef_H,stat=ierr) 356 IF ( ierr /= 0 ) PRINT*,' pb in dealllocate Ccoef_Q, Dcoef_Q, Ccoef_H, Dcoef_H, ierr=', ierr 357 DEALLOCATE(gamaq, gamah,stat=ierr) 358 IF ( ierr /= 0 ) PRINT*,' pb in dealllocate gamaq, gamah, ierr=', ierr 359 DEALLOCATE(Kcoefhq,stat=ierr) 360 IF ( ierr /= 0 ) PRINT*,' pb in dealllocate Kcoefhq, ierr=', ierr 356 361 357 362 END SUBROUTINE climb_hq_up -
LMDZ4/trunk/libf/phylmd/conf_phys.F90
r973 r996 5 5 ! 6 6 7 subroutine conf_phys(o cean, ok_veget, ok_journe, ok_mensuel, ok_instan, ok_hf, &7 subroutine conf_phys(ok_journe, ok_mensuel, ok_instan, ok_hf, & 8 8 & solarlong0,seuil_inversion, & 9 9 & fact_cldcon, facttemps,ok_newmicro,iflag_radia,& … … 16 16 17 17 use IOIPSL 18 !!!! USE surface_data, ONLY : ocean, ok_veget 18 USE surface_data 19 19 20 20 implicit none … … 51 51 ! Sortie: 52 52 character (len = 6) :: ocean 53 logical :: ok_ veget, ok_newmicro53 logical :: ok_newmicro 54 54 integer :: iflag_radia 55 55 logical :: ok_journe, ok_mensuel, ok_instan, ok_hf … … 116 116 REAL,SAVE :: ecrit_hf_omp, ecrit_day_omp, ecrit_mth_omp, ecrit_reg_omp 117 117 REAL,SAVE :: ecrit_tra_omp 118 LOGICAL, SAVE :: ok_slab_sicOBS_omp119 118 REAL,SAVE :: cvl_corr_omp 120 119 LOGICAL,SAVE :: ok_lic_melt_omp … … 997 996 call getin('ecrit_reg',ecrit_reg_omp) 998 997 ! 999 !1000 !1001 !Config Key = ok_slab_sicOBS1002 !Config Desc =1003 !Config Def = .true.1004 !Config Help = Pour faire tourner le slab avec fraction1005 ! de glace de mer Observee1006 !1007 ok_slab_sicOBS_omp = .true.1008 call getin('ok_slab_sicOBS', ok_slab_sicOBS_omp)1009 998 ! 1010 999 ! … … 1198 1187 ecrit_tra = ecrit_tra_omp 1199 1188 ecrit_reg = ecrit_reg_omp 1200 ok_slab_sicOBS = ok_slab_sicOBS_omp1201 1189 cvl_corr = cvl_corr_omp 1202 1190 ok_lic_melt = ok_lic_melt_omp … … 1213 1201 !$OMP MASTER 1214 1202 1203 ! Attribution of new parmeters according to parameters in .def 1204 IF (ocean=='couple' .OR. ocean=='opa8') THEN 1205 type_ocean='couple' 1206 version_ocean='opa8' 1207 ELSE IF (ocean=='nemo') THEN 1208 type_ocean='couple' 1209 version_ocean='nemo' 1210 ELSE IF (ocean=='force') THEN 1211 type_ocean='force' 1212 version_ocean='xxxxxx' 1213 ELSE IF (ocean=='slab') THEN 1214 type_ocean='slab' 1215 version_ocean='sicOBS' 1216 ELSE 1217 WRITE(numout,*)' ERROR ocean not valid : ocean= ', ocean 1218 CALL abort_gcm('conf_phys','ocean not valid',1) 1219 END IF 1220 1215 1221 write(numout,*)' ##############################################' 1216 1222 write(numout,*)' Configuration des parametres de la physique: ' 1217 1223 write(numout,*)' Config ocean = ', ocean 1224 write(numout,*)' Type ocean = ', type_ocean 1225 write(numout,*)' Version ocean = ', version_ocean 1218 1226 write(numout,*)' Config veget = ', ok_veget 1219 1227 write(numout,*)' Sortie journaliere = ', ok_journe -
LMDZ4/trunk/libf/phylmd/cpl_mod.F90
r987 r996 32 32 PRIVATE 33 33 34 ! All subroutine are public except cpl_send_all and cpl_receive_all35 PUBLIC :: cpl_init, cpl_receive_ ocean_fields, cpl_receive_seaice_fields, &34 ! All subroutine are public except cpl_send_all 35 PUBLIC :: cpl_init, cpl_receive_frac, cpl_receive_ocean_fields, cpl_receive_seaice_fields, & 36 36 cpl_send_ocean_fields, cpl_send_seaice_fields, cpl_send_land_fields, & 37 37 cpl_send_landice_fields, gath2cpl … … 68 68 !$OMP THREADPRIVATE(read_alb_sic) 69 69 70 ! fraction for different surface, saved during whole coupling period71 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: pctsrf_sav72 !$OMP THREADPRIVATE(pctsrf_sav)73 70 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: unity 74 71 !$OMP THREADPRIVATE(unity) … … 88 85 !$OMP THREADPRIVATE(cpl_windsp2D) 89 86 90 ! variable for OPENMP parallelisation 91 87 ! variables for OPENMP parallelisation 92 88 INTEGER,ALLOCATABLE,DIMENSION(:),SAVE :: knon_omp 93 89 REAL,ALLOCATABLE,DIMENSION(:,:),SAVE :: buffer_omp … … 146 142 ALLOCATE(unity(klon), stat = error) 147 143 sum_error = sum_error + error 148 ALLOCATE(pctsrf_sav(klon,nbsrf), stat = error)149 sum_error = sum_error + error150 144 ALLOCATE(cpl_sols(klon,2), stat = error) 151 145 sum_error = sum_error + error … … 196 190 unity(ig) = ig 197 191 ENDDO 198 pctsrf_sav = 0. 199 200 cpl_sols = 0. ; cpl_nsol = 0. ; cpl_rain = 0. ; cpl_snow = 0. 201 cpl_evap = 0. ; cpl_tsol = 0. ; cpl_fder = 0. ; cpl_albe = 0. 202 cpl_taux = 0. ; cpl_tauy = 0. ; cpl_rriv2D = 0. ; cpl_rcoa2D = 0. 203 cpl_rlic2D = 0. ; cpl_windsp = 0. 192 193 ! cpl_sols = 0. ; cpl_nsol = 0. ; cpl_rain = 0. ; cpl_snow = 0. 194 ! cpl_evap = 0. ; cpl_tsol = 0. ; cpl_fder = 0. ; cpl_albe = 0. 195 ! cpl_taux = 0. ; cpl_tauy = 0. ; cpl_rriv2D = 0. ; cpl_rcoa2D = 0. 196 ! cpl_rlic2D = 0. ; cpl_windsp = 0. 204 197 205 198 !************************************************************************************* … … 262 255 263 256 !$OMP MASTER 264 ALLOCATE(knon_omp(0:omp_size-1))265 ALLOCATE(buffer_omp(klon_mpi,0:omp_size-1))257 ALLOCATE(knon_omp(0:omp_size-1)) 258 ALLOCATE(buffer_omp(klon_mpi,0:omp_size-1)) 266 259 !$OMP END MASTER 267 260 !$OMP BARRIER … … 272 265 !************************************************************************************* 273 266 ! 274 275 SUBROUTINE cpl_receive_ all(itime, dtime, pctsrf)276 ! This subroutine re ads from coupler for both ocean and seaice267 268 SUBROUTINE cpl_receive_frac(itime, dtime, pctsrf, is_modified) 269 ! This subroutine receives from coupler for both ocean and seaice 277 270 ! 4 fields : read_sst, read_sic, read_sit and read_alb_sic. 271 ! The new sea-ice-land-landice fraction is returned. The others fields 272 ! are stored in this module. 273 USE surface_data 278 274 279 275 INCLUDE "indicesol.h" … … 283 279 INCLUDE "dimensions.h" 284 280 285 ! Input arguments281 ! Arguments 286 282 !************************************************************************************ 287 INTEGER, INTENT(IN) :: itime 288 REAL, INTENT(IN) :: dtime 289 REAL, DIMENSION(klon,nbsrf), INTENT(IN) :: pctsrf 283 INTEGER, INTENT(IN) :: itime 284 REAL, INTENT(IN) :: dtime 285 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: pctsrf 286 LOGICAL, INTENT(OUT) :: is_modified 290 287 291 288 ! Local variables 292 289 !************************************************************************************ 293 INTEGER :: j, i g, il_time_secs290 INTEGER :: j, i, time_sec 294 291 INTEGER :: itau_w 295 292 INTEGER, DIMENSION(iim*(jjm+1)) :: ndexcs 296 CHARACTER(len = 20) :: modname = 'cpl_receive_ all'293 CHARACTER(len = 20) :: modname = 'cpl_receive_frac' 297 294 CHARACTER(len = 80) :: abort_message 298 295 REAL, DIMENSION(klon) :: read_sic1D 299 REAL, DIMENSION(iim,jj_nb,jpfldo2a) :: tab_read_flds300 REAL, DIMENSION( iim,jj_nb) :: read_sic296 REAL, DIMENSION(iim,jj_nb,jpfldo2a) :: tab_read_flds 297 REAL, DIMENSION(klon,nbsrf) :: pctsrf_old 301 298 302 299 !************************************************************************************* … … 306 303 !************************************************************************************* 307 304 305 is_modified=.FALSE. 306 307 ! Check if right moment to recevie from coupler 308 IF (MOD(itime, nexca) == 1) THEN 309 is_modified=.TRUE. 310 311 time_sec=(itime-1)*dtime 308 312 #ifdef CPP_COUPLE 309 il_time_secs=(itime-1)*dtime310 313 !$OMP MASTER 311 CALL fromcpl(il_time_secs, tab_read_flds)314 CALL fromcpl(time_sec, tab_read_flds) 312 315 !$OMP END MASTER 313 316 #endif 314 317 315 318 ! NetCDF output of received fields 316 IF (is_sequential) THEN 317 ndexcs(:) = 0 318 itau_w = itau_phy + itime 319 DO ig = 1, jpfldo2a 320 CALL histwrite(nidcs,cl_read(ig),itau_w,tab_read_flds(:,:,ig),iim*(jjm+1),ndexcs) 321 END DO 322 ENDIF 323 319 IF (is_sequential) THEN 320 ndexcs(:) = 0 321 itau_w = itau_phy + itime 322 DO i = 1, jpfldo2a 323 CALL histwrite(nidcs,cl_read(i),itau_w,tab_read_flds(:,:,i),iim*(jjm+1),ndexcs) 324 END DO 325 ENDIF 326 327 ! Save each field in a 2D array. 324 328 !$OMP MASTER 325 326 ! Save each field in a 2D array. 327 328 IF (OPA_version=='OPA9') THEN 329 read_sst(:,:) = tab_read_flds(:,:,1) ! Sea surface temperature 330 read_sic(:,:) = tab_read_flds(:,:,2) ! Sea ice concentration 331 read_sit(:,:) = tab_read_flds(:,:,3) ! Sea ice temperature 332 read_alb_sic(:,:) = tab_read_flds(:,:,4) ! Albedo at sea ice 333 ELSE IF (OPA_version=='OPA8') THEN 334 read_sst(:,:) = tab_read_flds(:,:,1) ! Sea surface temperature 335 read_sic(:,:) = tab_read_flds(:,:,2) ! Sea ice concentration 336 read_alb_sic(:,:) = tab_read_flds(:,:,3) ! Albedo at sea ice 337 read_sit(:,:) = tab_read_flds(:,:,4) ! Sea ice temperature 338 ELSE 339 STOP 'Bad OPA version for coupled model' 340 ENDIF 341 342 !************************************************************************************* 343 ! Temperature and albedo are weighted with the fraction of sea-ice(read-sic) 344 ! 345 !************************************************************************************* 346 DO j = 1, jj_nb 347 DO ig = 1, iim 348 IF (ABS(1. - read_sic(ig,j)) < 0.00001) THEN 349 read_sst(ig,j) = RTT - 1.8 350 read_sit(ig,j) = read_sit(ig,j) / read_sic(ig,j) 351 read_alb_sic(ig,j) = read_alb_sic(ig,j) / read_sic(ig,j) 352 ELSE IF (ABS(read_sic(ig,j)) < 0.00001) THEN 353 read_sst(ig,j) = read_sst(ig,j) / (1. - read_sic(ig,j)) 354 read_sit(ig,j) = read_sst(ig,j) 355 read_alb_sic(ig,j) = 0.6 356 ELSE 357 read_sst(ig,j) = read_sst(ig,j) / (1. - read_sic(ig,j)) 358 read_sit(ig,j) = read_sit(ig,j) / read_sic(ig,j) 359 read_alb_sic(ig,j) = read_alb_sic(ig,j) / read_sic(ig,j) 329 IF (version_ocean=='nemo') THEN 330 read_sst(:,:) = tab_read_flds(:,:,1) ! Sea surface temperature 331 read_sic(:,:) = tab_read_flds(:,:,2) ! Sea ice concentration 332 read_sit(:,:) = tab_read_flds(:,:,3) ! Sea ice temperature 333 read_alb_sic(:,:) = tab_read_flds(:,:,4) ! Albedo at sea ice 334 ELSE IF (version_ocean=='opa8') THEN 335 read_sst(:,:) = tab_read_flds(:,:,1) ! Sea surface temperature (multiplicated by fraction) 336 read_sic(:,:) = tab_read_flds(:,:,2) ! Sea ice concentration 337 read_alb_sic(:,:) = tab_read_flds(:,:,3) ! Albedo at sea ice (multiplicated by fraction) 338 read_sit(:,:) = tab_read_flds(:,:,4) ! Sea ice temperature (multiplicated by fraction) 339 END IF 340 !$OMP END MASTER 341 342 !************************************************************************************* 343 ! Transform seaice fraction (read_sic : ocean-seaice mask) into global 344 ! fraction (pctsrf : ocean-seaice-land-landice mask) 345 ! 346 !************************************************************************************* 347 CALL cpl2gath(read_sic, read_sic1D, klon, unity) 348 349 pctsrf_old(:,:) = pctsrf(:,:) 350 DO i = 1, klon 351 ! treatment only of points with ocean and/or seaice 352 IF (pctsrf_old(i,is_oce) + pctsrf_old(i,is_sic) > 0.) THEN 353 pctsrf(i,is_sic) = (pctsrf_old(i,is_oce) + pctsrf_old(i,is_sic)) & 354 * read_sic1D(i) 355 pctsrf(i,is_oce) = (pctsrf_old(i,is_oce) + pctsrf_old(i,is_sic)) & 356 - pctsrf(i,is_sic) 360 357 ENDIF 361 358 ENDDO 362 ENDDO 363 !$OMP END MASTER 364 365 !************************************************************************************* 366 ! Transform seaice fraction, read_sic into pctsrf_sav 367 ! 368 !************************************************************************************* 369 CALL cpl2gath(read_sic, read_sic1D, klon, unity) 370 371 DO ig = 1, klon 372 ! treatment only of ocean and/or seaice points 373 IF (pctsrf(ig,is_oce) > epsfra .OR. & 374 pctsrf(ig,is_sic) > epsfra) THEN 375 pctsrf_sav(ig,is_sic) = (pctsrf(ig,is_oce) + pctsrf(ig,is_sic)) & 376 * read_sic1D(ig) 377 pctsrf_sav(ig,is_oce) = (pctsrf(ig,is_oce) + pctsrf(ig,is_sic)) & 378 - pctsrf_sav(ig,is_sic) 379 ENDIF 380 ENDDO 381 382 !************************************************************************************* 383 ! To avoid round up problems 384 ! 385 !************************************************************************************* 386 WHERE (ABS(pctsrf_sav(:,is_sic)) .LE. 2.*EPSILON(pctsrf_sav(1,is_sic))) 387 pctsrf_sav(:,is_sic) = 0. 388 pctsrf_sav(:,is_oce) = pctsrf(:,is_oce) + pctsrf(:,is_sic) 389 ENDWHERE 390 WHERE (ABS(pctsrf_sav(:,is_oce)) .LE. 2.*EPSILON(pctsrf_sav(1,is_oce))) 391 pctsrf_sav(:,is_sic) = pctsrf(:,is_oce) + pctsrf(:,is_sic) 392 pctsrf_sav(:,is_oce) = 0. 393 ENDWHERE 394 IF (MINVAL(pctsrf_sav(:,is_oce)) < 0.) THEN 395 WRITE(*,*)'Pb fraction ocean inferieure a 0' 396 WRITE(*,*)'au point ',MINLOC(pctsrf_sav(:,is_oce)) 397 WRITE(*,*)'valeur = ',MINVAL(pctsrf_sav(:,is_oce)) 398 abort_message = 'voir ci-dessus' 399 CALL abort_gcm(modname,abort_message,1) 400 ENDIF 401 IF (MINVAL(pctsrf_sav(:,is_sic)) < 0.) THEN 402 WRITE(*,*)'Pb fraction glace inferieure a 0' 403 WRITE(*,*)'au point ',MINLOC(pctsrf_sav(:,is_sic)) 404 WRITE(*,*)'valeur = ',MINVAL(pctsrf_sav(:,is_sic)) 405 abort_message = 'voir ci-dessus' 406 CALL abort_gcm(modname,abort_message,1) 407 ENDIF 408 409 END SUBROUTINE cpl_receive_all 410 ! 411 !************************************************************************************* 412 ! 413 SUBROUTINE cpl_receive_ocean_fields(itime, dtime, knon, knindex, pctsrf, & 414 tsurf_new, pctsrf_oce) 415 ! 416 ! This routine reads, if first time step in a coupling period, all fields reveived from 417 ! coupler for all types of surfaces. It returns the fields for the ocean surface which 418 ! are the sea surface temperature and the fraction of ocean. 419 ! The fields are transformed into 1D arrays with valid points : 420 ! tsurf_new(1:knon), pctsrf(1:klon). 359 360 END IF ! if time to receive 361 362 END SUBROUTINE cpl_receive_frac 363 364 ! 365 !************************************************************************************* 366 ! 367 368 SUBROUTINE cpl_receive_ocean_fields(knon, knindex, tsurf_new) 369 ! 370 ! This routine returns the field for the ocean that has been read from the coupler 371 ! (done earlier with cpl_receive_frac). The field is the temperature. 372 ! The temperature is transformed into 1D array with valid points from index 1 to knon. 421 373 ! 422 374 INCLUDE "indicesol.h" … … 424 376 ! Input arguments 425 377 !************************************************************************************* 426 INTEGER, INTENT(IN) :: itime427 REAL, INTENT(IN) :: dtime428 378 INTEGER, INTENT(IN) :: knon 429 379 INTEGER, DIMENSION(klon), INTENT(IN) :: knindex 430 REAL, DIMENSION(klon,nbsrf), INTENT(IN) :: pctsrf431 380 432 381 ! Output arguments 433 382 !************************************************************************************* 434 383 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new 435 REAL, DIMENSION(klon), INTENT(OUT) :: pctsrf_oce 436 437 !************************************************************************************* 438 ! If first time step in a coupling period receive all fields for all types 439 ! of surfaces from coupler : read_sst, read_sit, read_alb_sic and pctsrf_sav. 440 ! 441 !************************************************************************************* 442 443 IF (MOD(itime, nexca) == 1) CALL cpl_receive_all(itime, dtime, pctsrf) 444 384 385 ! Local variables 386 !************************************************************************************* 387 INTEGER :: i 388 REAL, DIMENSION(klon) :: sic_new 445 389 446 390 !************************************************************************************* … … 449 393 !************************************************************************************* 450 394 CALL cpl2gath(read_sst, tsurf_new, knon, knindex) 451 pctsrf_oce(:) = pctsrf_sav(:,is_oce) 452 395 CALL cpl2gath(read_sic, sic_new, knon, knindex) 396 397 !************************************************************************************* 398 ! The fields received from the coupler have to be weighted with the fraction of ocean 399 ! in relation to the total sea-ice+ocean 400 ! 401 !************************************************************************************* 402 DO i=1, knon 403 tsurf_new(i) = tsurf_new(i)/(1. - sic_new(i)) 404 END DO 453 405 454 406 END SUBROUTINE cpl_receive_ocean_fields 455 ! 456 !************************************************************************************* 457 ! 407 408 ! 409 !************************************************************************************* 410 ! 411 458 412 SUBROUTINE cpl_receive_seaice_fields(knon, knindex, & 459 tsurf_new, alb_new , pctsrf_sic)413 tsurf_new, alb_new) 460 414 ! 461 415 ! This routine returns the fields for the seaice that have been read from the coupler 462 ! (done earlier with cpl_receive_ ocean_fields). These fields are the temperature and416 ! (done earlier with cpl_receive_frac). These fields are the temperature and 463 417 ! albedo at sea ice surface and fraction of sea ice. 464 ! The fields are transformed into 1D arrays with valid points : 465 ! tsurf_new(1:knon), alb_new(1:knon), pctsrf(1:klon). 466 ! 467 INCLUDE "indicesol.h" 418 ! The fields are transformed into 1D arrays with valid points from index 1 to knon. 419 ! 468 420 469 421 ! Input arguments … … 476 428 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new 477 429 REAL, DIMENSION(klon), INTENT(OUT) :: alb_new 478 REAL, DIMENSION(klon), INTENT(OUT) :: pctsrf_sic 479 430 431 ! Local variables 432 !************************************************************************************* 433 INTEGER :: i 434 REAL, DIMENSION(klon) :: sic_new 480 435 481 436 !************************************************************************************* … … 485 440 CALL cpl2gath(read_sit, tsurf_new, knon, knindex) 486 441 CALL cpl2gath(read_alb_sic, alb_new, knon, knindex) 487 pctsrf_sic(:) = pctsrf_sav(:,is_sic) 442 CALL cpl2gath(read_sic, sic_new, knon, knindex) 443 444 !************************************************************************************* 445 ! The fields received from the coupler have to be weighted with the sea-ice 446 ! concentration (in relation to the total sea-ice + ocean). 447 ! 448 !************************************************************************************* 449 DO i= 1, knon 450 tsurf_new(i) = tsurf_new(i) / sic_new(i) 451 alb_new(i) = alb_new(i) / sic_new(i) 452 END DO 488 453 489 454 END SUBROUTINE cpl_receive_seaice_fields … … 535 500 !************************************************************************************* 536 501 IF (MOD(itime, nexca) == 1) THEN 537 cpl_sols( :,cpl_index) = 0.0538 cpl_nsol( :,cpl_index) = 0.0539 cpl_rain( :,cpl_index) = 0.0540 cpl_snow( :,cpl_index) = 0.0541 cpl_evap( :,cpl_index) = 0.0542 cpl_tsol( :,cpl_index) = 0.0543 cpl_fder( :,cpl_index) = 0.0544 cpl_albe( :,cpl_index) = 0.0545 cpl_taux( :,cpl_index) = 0.0546 cpl_tauy( :,cpl_index) = 0.0547 cpl_windsp( :,cpl_index) = 0.0502 cpl_sols(1:knon,cpl_index) = 0.0 503 cpl_nsol(1:knon,cpl_index) = 0.0 504 cpl_rain(1:knon,cpl_index) = 0.0 505 cpl_snow(1:knon,cpl_index) = 0.0 506 cpl_evap(1:knon,cpl_index) = 0.0 507 cpl_tsol(1:knon,cpl_index) = 0.0 508 cpl_fder(1:knon,cpl_index) = 0.0 509 cpl_albe(1:knon,cpl_index) = 0.0 510 cpl_taux(1:knon,cpl_index) = 0.0 511 cpl_tauy(1:knon,cpl_index) = 0.0 512 cpl_windsp(1:knon,cpl_index) = 0.0 548 513 ENDIF 549 514 … … 709 674 !************************************************************************************* 710 675 IF (MOD(itime, nexca) == 1) THEN 711 cpl_sols( :,cpl_index) = 0.0712 cpl_nsol( :,cpl_index) = 0.0713 cpl_rain( :,cpl_index) = 0.0714 cpl_snow( :,cpl_index) = 0.0715 cpl_evap( :,cpl_index) = 0.0716 cpl_tsol( :,cpl_index) = 0.0717 cpl_fder( :,cpl_index) = 0.0718 cpl_albe( :,cpl_index) = 0.0719 cpl_taux( :,cpl_index) = 0.0720 cpl_tauy( :,cpl_index) = 0.0676 cpl_sols(1:knon,cpl_index) = 0.0 677 cpl_nsol(1:knon,cpl_index) = 0.0 678 cpl_rain(1:knon,cpl_index) = 0.0 679 cpl_snow(1:knon,cpl_index) = 0.0 680 cpl_evap(1:knon,cpl_index) = 0.0 681 cpl_tsol(1:knon,cpl_index) = 0.0 682 cpl_fder(1:knon,cpl_index) = 0.0 683 cpl_albe(1:knon,cpl_index) = 0.0 684 cpl_taux(1:knon,cpl_index) = 0.0 685 cpl_tauy(1:knon,cpl_index) = 0.0 721 686 ENDIF 722 687 … … 893 858 ! 894 859 INCLUDE "dimensions.h" 895 860 896 861 ! Input varibales 897 862 !************************************************************************************* … … 944 909 ! all calculations at the different surfaces have to be done before. 945 910 ! 911 USE surface_data 946 912 ! Some includes 947 913 !************************************************************************************* … … 962 928 INTEGER :: error, sum_error, j 963 929 INTEGER :: itau_w 964 INTEGER :: il_time_secs930 INTEGER :: time_sec 965 931 INTEGER, DIMENSION(iim*(jjm+1)) :: ndexct 966 932 REAL :: Up, Down … … 994 960 ! 995 961 !************************************************************************************* 996 !! AC >>997 998 962 !$OMP MASTER 999 IF (OPA_version=='OPA9') THEN 1000 tab_flds(:,:,7) = cpl_windsp2D(:,:) 1001 tab_flds(:,:,14) = cpl_sols2D(:,:,2) 1002 tab_flds(:,:,12) = cpl_sols2D(:,:,1) 1003 tab_flds(:,:,15) = cpl_nsol2D(:,:,2) 1004 tab_flds(:,:,13) = cpl_nsol2D(:,:,1) 1005 tab_flds(:,:,16) = cpl_fder2D(:,:,2) 1006 tab_flds(:,:,11) = cpl_evap2D(:,:,2) 1007 tab_flds(:,:,18) = cpl_rriv2D(:,:) 1008 tab_flds(:,:,19) = cpl_rcoa2D(:,:) 1009 ELSE IF (OPA_version=='OPA8') THEN 1010 tab_flds(:,:,7) = cpl_windsp2D(:,:) 1011 tab_flds(:,:,8) = cpl_sols2D(:,:,2) 1012 tab_flds(:,:,9) = cpl_sols2D(:,:,1) 1013 tab_flds(:,:,10) = cpl_nsol2D(:,:,2) 1014 tab_flds(:,:,11) = cpl_nsol2D(:,:,1) 1015 tab_flds(:,:,12) = cpl_fder2D(:,:,2) 1016 tab_flds(:,:,13) = cpl_evap2D(:,:,2) 1017 tab_flds(:,:,14) = cpl_evap2D(:,:,1) 1018 tab_flds(:,:,17) = cpl_rcoa2D(:,:) 1019 tab_flds(:,:,18) = cpl_rriv2D(:,:) 1020 ELSE 1021 STOP 'Bad OPA version for coupled model' 1022 ENDIF 1023 963 IF (version_ocean=='nemo') THEN 964 tab_flds(:,:,7) = cpl_windsp2D(:,:) 965 tab_flds(:,:,14) = cpl_sols2D(:,:,2) 966 tab_flds(:,:,12) = cpl_sols2D(:,:,1) 967 tab_flds(:,:,15) = cpl_nsol2D(:,:,2) 968 tab_flds(:,:,13) = cpl_nsol2D(:,:,1) 969 tab_flds(:,:,16) = cpl_fder2D(:,:,2) 970 tab_flds(:,:,11) = cpl_evap2D(:,:,2) 971 tab_flds(:,:,18) = cpl_rriv2D(:,:) 972 tab_flds(:,:,19) = cpl_rcoa2D(:,:) 973 ELSE IF (version_ocean=='opa8') THEN 974 tab_flds(:,:,7) = cpl_windsp2D(:,:) 975 tab_flds(:,:,8) = cpl_sols2D(:,:,2) 976 tab_flds(:,:,9) = cpl_sols2D(:,:,1) 977 tab_flds(:,:,10) = cpl_nsol2D(:,:,2) 978 tab_flds(:,:,11) = cpl_nsol2D(:,:,1) 979 tab_flds(:,:,12) = cpl_fder2D(:,:,2) 980 tab_flds(:,:,13) = cpl_evap2D(:,:,2) 981 tab_flds(:,:,14) = cpl_evap2D(:,:,1) 982 tab_flds(:,:,17) = cpl_rcoa2D(:,:) 983 tab_flds(:,:,18) = cpl_rriv2D(:,:) 984 END IF 985 1024 986 !************************************************************************************* 1025 987 ! Transform the fraction of sub-surfaces from 1D to 2D array … … 1028 990 pctsrf2D(:,:,:) = 0. 1029 991 !$OMP END MASTER 1030 1031 992 CALL gath2cpl(pctsrf(:,is_oce), pctsrf2D(:,:,is_oce), klon, unity) 1032 993 CALL gath2cpl(pctsrf(:,is_sic), pctsrf2D(:,:,is_sic), klon, unity) … … 1040 1001 IF (is_omp_root) THEN 1041 1002 1042 DO j = 1, jj_nb1043 tmp_calv(:,j) = DOT_PRODUCT (cpl_rlic2D(1:iim,j), &1044 pctsrf2D(1:iim,j,is_lic)) / REAL(iim)1045 ENDDO1046 1047 1048 IF (is_parallel) THEN1003 DO j = 1, jj_nb 1004 tmp_calv(:,j) = DOT_PRODUCT (cpl_rlic2D(1:iim,j), & 1005 pctsrf2D(1:iim,j,is_lic)) / REAL(iim) 1006 ENDDO 1007 1008 1009 IF (is_parallel) THEN 1049 1010 IF (.NOT. is_north_pole) THEN 1050 1011 #ifdef CPP_PARA … … 1053 1014 #endif 1054 1015 ENDIF 1055 1016 1056 1017 IF (.NOT. is_south_pole) THEN 1057 1018 #ifdef CPP_PARA … … 1060 1021 #endif 1061 1022 ENDIF 1062 1023 1063 1024 IF (.NOT. is_north_pole .AND. ii_begin /=1) THEN 1064 1025 Up=Up+tmp_calv(iim,1) 1065 1026 tmp_calv(:,1)=Up 1066 1027 ENDIF 1067 1028 1068 1029 IF (.NOT. is_south_pole .AND. ii_end /= iim) THEN 1069 1030 Down=Down+tmp_calv(1,jj_nb) … … 1071 1032 ENDIF 1072 1033 ENDIF 1073 1074 IF (OPA_version=='OPA9') THEN 1075 tab_flds(:,:,17) = tmp_calv(:,:) 1076 ELSE IF (OPA_version=='OPA8') THEN 1077 tab_flds(:,:,17) = tmp_calv(:,:) 1078 ELSE 1079 STOP 'Bad OPA version for coupled model' 1080 ENDIF 1081 1034 1035 IF (version_ocean=='nemo') THEN 1036 tab_flds(:,:,17) = tmp_calv(:,:) 1037 ELSE IF (version_ocean=='opa8') THEN 1038 tab_flds(:,:,19) = tmp_calv(:,:) 1039 END IF 1082 1040 1083 1041 !************************************************************************************* … … 1089 1047 ! 1090 1048 !************************************************************************************* 1091 ! fraction oce+seaice 1092 deno = pctsrf2D(:,:,is_oce) + pctsrf2D(:,:,is_sic) 1093 1094 IF (OPA_version=='OPA9') THEN 1095 1096 tab_flds(:,:,10) = 0.0 1097 tmp_taux(:,:) = 0.0 1098 tmp_tauy(:,:) = 0.0 1099 ! fraction oce+seaice 1100 ! For all valid grid cells containing some fraction of ocean or sea-ice 1101 WHERE ( deno(:,:) /= 0 ) 1102 tab_flds(:,:,10) = cpl_snow2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1103 cpl_snow2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1104 1105 tmp_taux = cpl_taux2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1106 cpl_taux2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1107 tmp_tauy = cpl_tauy2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1108 cpl_tauy2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1109 ENDWHERE 1110 tab_flds(:,:,8) = (cpl_evap2D(:,:,1) - ( cpl_rain2D(:,:,1) + cpl_snow2D(:,:,1))) 1111 tab_flds(:,:,9) = (cpl_evap2D(:,:,2) - ( cpl_rain2D(:,:,2) + cpl_snow2D(:,:,2))) 1112 1113 ELSE IF (OPA_version=='OPA8') THEN 1114 1115 tab_flds(:,:,15) = 0.0 1116 tab_flds(:,:,16) = 0.0 1117 tmp_taux(:,:) = 0.0 1118 tmp_tauy(:,:) = 0.0 1119 ! For all valid grid cells containing some fraction of ocean or sea-ice 1120 WHERE ( deno(:,:) /= 0 ) 1121 tab_flds(:,:,15) = cpl_rain2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1122 cpl_rain2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1123 tab_flds(:,:,16) = cpl_snow2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1124 cpl_snow2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1125 1126 tmp_taux = cpl_taux2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1127 cpl_taux2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1128 tmp_tauy = cpl_tauy2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1129 cpl_tauy2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1130 ENDWHERE 1131 1132 ELSE 1133 STOP 'Bad OPA version for coupled model' 1134 ENDIF 1135 1136 ENDIF ! is_omp_root 1137 1138 1139 ! AC << 1049 ! fraction oce+seaice 1050 deno = pctsrf2D(:,:,is_oce) + pctsrf2D(:,:,is_sic) 1051 1052 IF (version_ocean=='nemo') THEN 1053 tab_flds(:,:,10) = 0.0 1054 tmp_taux(:,:) = 0.0 1055 tmp_tauy(:,:) = 0.0 1056 ! For all valid grid cells containing some fraction of ocean or sea-ice 1057 WHERE ( deno(:,:) /= 0 ) 1058 tab_flds(:,:,10) = cpl_snow2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1059 cpl_snow2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1060 1061 tmp_taux = cpl_taux2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1062 cpl_taux2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1063 tmp_tauy = cpl_tauy2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1064 cpl_tauy2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1065 ENDWHERE 1066 tab_flds(:,:,8) = (cpl_evap2D(:,:,1) - ( cpl_rain2D(:,:,1) + cpl_snow2D(:,:,1))) 1067 tab_flds(:,:,9) = (cpl_evap2D(:,:,2) - ( cpl_rain2D(:,:,2) + cpl_snow2D(:,:,2))) 1068 1069 ELSE IF (version_ocean=='opa8') THEN 1070 tab_flds(:,:,15) = 0.0 1071 tab_flds(:,:,16) = 0.0 1072 tmp_taux(:,:) = 0.0 1073 tmp_tauy(:,:) = 0.0 1074 ! For all valid grid cells containing some fraction of ocean or sea-ice 1075 WHERE ( deno(:,:) /= 0 ) 1076 tab_flds(:,:,15) = cpl_rain2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1077 cpl_rain2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1078 tab_flds(:,:,16) = cpl_snow2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1079 cpl_snow2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1080 1081 tmp_taux = cpl_taux2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1082 cpl_taux2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1083 tmp_tauy = cpl_tauy2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1084 cpl_tauy2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1085 ENDWHERE 1086 END IF 1087 1088 ENDIF ! is_omp_root 1089 1140 1090 !************************************************************************************* 1141 1091 ! Transform the wind components from local atmospheric 2D coordinates to geocentric … … 1145 1095 1146 1096 ! Transform the longitudes and latitudes on 2D arrays 1147 1148 1097 CALL gather_omp(rlon,rlon_mpi) 1149 1098 CALL gather_omp(rlat,rlat_mpi) … … 1211 1160 ! 1212 1161 !************************************************************************************* 1162 time_sec=(itime-1)*dtime 1213 1163 #ifdef CPP_COUPLE 1214 il_time_secs=(itime-1)*dtime1215 1164 !$OMP MASTER 1216 CALL intocpl( il_time_secs, lafin, tab_flds(:,:,:))1165 CALL intocpl(time_sec, lafin, tab_flds(:,:,:)) 1217 1166 !$OMP END MASTER 1218 1167 #endif … … 1239 1188 ! 1240 1189 SUBROUTINE cpl2gath(champ_in, champ_out, knon, knindex) 1241 USE mod_phys_lmdz_para1190 USE mod_phys_lmdz_para 1242 1191 ! Cette routine ecrit un champ 'gathered' sur la grille 2D pour le passer 1243 1192 ! au coupleur. … … 1269 1218 !************************************************************************************* 1270 1219 ! 1271 1272 1273 1220 ! Transform from 2 dimensions (iim,jj_nb) to 1 dimension (klon) 1274 1221 !$OMP MASTER … … 1283 1230 champ_out(i) = temp_omp(ig) 1284 1231 ENDDO 1285 1286 1232 1287 1233 END SUBROUTINE cpl2gath -
LMDZ4/trunk/libf/phylmd/ini_paramLMDZ_phy.h
r879 r996 31 31 . "once", zstophy,zout) 32 32 c 33 CALL histdef(nid_ctesGCM, "ok_slab_sicOBS",34 ."ok_slab_sicOBS= 1: glace de mer observee, =0: gl.mer calculee35 . par le slab", "-",36 . iim,jjmp1,nhori, 1,1,1, -99, 32,37 . "once", zstophy,zout)38 c39 33 CALL histdef(nid_ctesGCM, "type_run", 40 34 . "Type run: 1= CLIM ou ENSP, 2= AMIP ou CFMI", -
LMDZ4/trunk/libf/phylmd/oasis.F90
r987 r996 44 44 !$OMP THREADPRIVATE(out_var_id) 45 45 46 CHARACTER(LEN=*),PARAMETER :: OPA_version='OPA9'47 46 48 47 #ifdef CPP_COUPLE … … 58 57 ! LF 09/2003 59 58 ! 59 USE surface_data, ONLY : version_ocean 60 60 INCLUDE "dimensions.h" 61 61 … … 130 130 ! Define symbolic name for fields exchanged from atmos to coupler, 131 131 ! must be the same as (1) of the field definition in namcouple: 132 IF (OPA_version=='OPA9') THEN 133 cl_writ(1)='COTAUXXU' 134 cl_writ(2)='COTAUYYU' 135 cl_writ(3)='COTAUZZU' 136 cl_writ(4)='COTAUXXV' 137 cl_writ(5)='COTAUYYV' 138 cl_writ(6)='COTAUZZV' 139 cl_writ(7)='COWINDSP' 140 cl_writ(8)='COPEFWAT' 141 cl_writ(9)='COPEFICE' 132 133 cl_writ(1)='COTAUXXU' 134 cl_writ(2)='COTAUYYU' 135 cl_writ(3)='COTAUZZU' 136 cl_writ(4)='COTAUXXV' 137 cl_writ(5)='COTAUYYV' 138 cl_writ(6)='COTAUZZV' 139 cl_writ(7)='COWINDSP' 140 141 IF (version_ocean=='nemo') THEN 142 cl_writ(8) ='COPEFWAT' 143 cl_writ(9) ='COPEFICE' 142 144 cl_writ(10)='COTOSPSU' 143 145 cl_writ(11)='COICEVAP' … … 150 152 cl_writ(18)='CRWOCERD' 151 153 cl_writ(19)='CRWOCECD' 152 ELSE IF (OPA_version=='OPA8') THEN 153 cl_writ(1)='COTAUXXU' 154 cl_writ(2)='COTAUYYU' 155 cl_writ(3)='COTAUZZU' 156 cl_writ(4)='COTAUXXV' 157 cl_writ(5)='COTAUYYV' 158 cl_writ(6)='COTAUZZV' 159 cl_writ(7)='COWINDSP' 160 cl_writ(8)='COSHFICE' 161 cl_writ(9)='COSHFOCE' 154 ELSE IF (version_ocean=='opa8') THEN 155 cl_writ(8) ='COSHFICE' 156 cl_writ(9) ='COSHFOCE' 162 157 cl_writ(10)='CONSFICE' 163 158 cl_writ(11)='CONSFOCE' … … 170 165 cl_writ(18)='CORIVFLU' 171 166 cl_writ(19)='COCALVIN' 172 ELSE173 STOP 'Bad OPA version for coupled model'174 167 ENDIF 175 168 … … 178 171 ! must be the same as (2) of the field definition in namcouple: 179 172 ! 180 IF (OPA_version=='OPA9') THEN 181 cl_read(1)='SISUTESW' 182 cl_read(2)='SIICECOV' 183 cl_read(4)='SIICEALW' 184 cl_read(3)='SIICTEMW' 185 ELSE IF (OPA_version=='OPA8') THEN 186 cl_read(1)='SISUTESW' 187 cl_read(2)='SIICECOV' 188 cl_read(3)='SIICEALW' 189 cl_read(4)='SIICTEMW' 190 ELSE 191 STOP 'Bad OPA version for coupled model' 192 ENDIF 193 173 IF (version_ocean=='nemo') THEN 174 cl_read(1)='SISUTESW' 175 cl_read(2)='SIICECOV' 176 cl_read(4)='SIICEALW' 177 cl_read(3)='SIICTEMW' 178 ELSE IF (version_ocean=='opa8') THEN 179 cl_read(1)='SISUTESW' 180 cl_read(2)='SIICECOV' 181 cl_read(3)='SIICEALW' 182 cl_read(4)='SIICTEMW' 183 END IF 184 194 185 il_var_nodims(1) = 2 195 186 il_var_nodims(2) = 1 -
LMDZ4/trunk/libf/phylmd/ocean_cpl_mod.F90
r888 r996 16 16 PRIVATE 17 17 18 PUBLIC :: ocean_cpl_init, ocean_cpl_get_vars, ocean_cpl_noice, ocean_cpl_ice 19 20 REAL, ALLOCATABLE, DIMENSION(:), SAVE :: tmp_flux_o 21 !$OMP THREADPRIVATE(tmp_flux_o) 22 REAL, ALLOCATABLE, DIMENSION(:), SAVE :: tmp_flux_g 23 !$OMP THREADPRIVATE(tmp_flux_g) 18 PUBLIC :: ocean_cpl_init, ocean_cpl_noice, ocean_cpl_ice 24 19 25 20 !**************************************************************************************** … … 43 38 CHARACTER (len = 80) :: abort_message 44 39 CHARACTER (len = 20) :: modname = 'ocean_cpl_init' 45 46 47 ALLOCATE(tmp_flux_o(klon), stat = error)48 IF (error /= 0) THEN49 abort_message='Pb allocation tmp_flux_o'50 CALL abort_gcm(modname,abort_message,1)51 ENDIF52 53 ALLOCATE(tmp_flux_g(klon), stat = error)54 IF (error /= 0) THEN55 abort_message='Pb allocation tmp_flux_g'56 CALL abort_gcm(modname,abort_message,1)57 ENDIF58 40 59 41 ! Initialize module cpl_init … … 71 53 p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum, & 72 54 petAcoef, peqAcoef, petBcoef, peqBcoef, & 73 ps, u1_lay, v1_lay, pctsrf_in,&55 ps, u1_lay, v1_lay, & 74 56 radsol, snow, agesno, & 75 57 qsurf, evap, fluxsens, fluxlat, & 76 tsurf_new, dflux_s, dflux_l , pctsrf_oce)58 tsurf_new, dflux_s, dflux_l) 77 59 ! 78 60 ! This subroutine treats the "open ocean", all grid points that are not entierly covered … … 101 83 REAL, DIMENSION(klon), INTENT(IN) :: ps 102 84 REAL, DIMENSION(klon), INTENT(IN) :: u1_lay, v1_lay 103 REAL, DIMENSION(klon,nbsrf), INTENT(IN) :: pctsrf_in104 85 105 86 ! In/Output arguments … … 115 96 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new 116 97 REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l 117 REAL, DIMENSION(klon), INTENT(OUT) :: pctsrf_oce118 98 119 99 ! Local variables … … 122 102 INTEGER, DIMENSION(1) :: iloc 123 103 REAL, DIMENSION(klon) :: cal, beta, dif_grnd 124 REAL, DIMENSION(klon) :: zx_sl125 104 REAL, DIMENSION(klon) :: fder_new 126 105 REAL, DIMENSION(klon) :: tsurf_cpl … … 134 113 135 114 !**************************************************************************************** 136 ! Receive sea-surface temperature(tsurf_cpl) and new fraction of ocean surface(pctsrf_oce) 137 ! from coupler 138 ! 139 !**************************************************************************************** 140 CALL cpl_receive_ocean_fields(itime, dtime, knon, knindex, pctsrf_in, & 141 tsurf_cpl, pctsrf_oce) 115 ! Receive sea-surface temperature(tsurf_cpl) from coupler 116 ! 117 !**************************************************************************************** 118 CALL cpl_receive_ocean_fields(knon, knindex, tsurf_cpl) 142 119 143 120 !**************************************************************************************** … … 176 153 177 154 !**************************************************************************************** 178 ! Flux ocean-atmosphere useful for "slab" ocean but here calculated only for printing179 ! usage later in physiq180 !181 !****************************************************************************************182 tmp_flux_o(:) = 0.0183 DO i=1, knon184 zx_sl(i) = RLVTT185 IF (tsurf_new(i) .LT. RTT) zx_sl(i) = RLSTT186 !IM flux_o(i) = fluxsens(i)-evap(i)*zx_sl(i)187 ! flux_o(i) = fluxsens(i) + fluxlat(i)188 IF (pctsrf_oce(knindex(i)) .GT. epsfra) THEN189 tmp_flux_o(knindex(i)) = fluxsens(i) + fluxlat(i)190 ENDIF191 ENDDO192 193 194 !****************************************************************************************195 155 ! Send and cumulate fields to the coupler 196 156 ! … … 213 173 p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum, & 214 174 petAcoef, peqAcoef, petBcoef, peqBcoef, & 215 ps, u1_lay, v1_lay, pctsrf _in, &175 ps, u1_lay, v1_lay, pctsrf, & 216 176 radsol, snow, qsurf, & 217 177 alb1_new, alb2_new, evap, fluxsens, fluxlat, & 218 tsurf_new, dflux_s, dflux_l , pctsrf_sic)178 tsurf_new, dflux_s, dflux_l) 219 179 ! 220 180 ! This subroutine treats the ocean where there is ice. The subroutine first receives … … 244 204 REAL, DIMENSION(klon), INTENT(IN) :: ps 245 205 REAL, DIMENSION(klon), INTENT(IN) :: u1_lay, v1_lay 246 REAL, DIMENSION(klon,nbsrf), INTENT(IN) :: pctsrf _in206 REAL, DIMENSION(klon,nbsrf), INTENT(IN) :: pctsrf 247 207 248 208 ! In/output arguments … … 258 218 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new 259 219 REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l 260 REAL, DIMENSION(klon), INTENT(OUT) :: pctsrf_sic261 220 262 221 ! Local variables … … 277 236 278 237 !**************************************************************************************** 279 ! Receive ocean temperature(tsurf_cpl), albedo(alb_cpl) and new fraction of 280 ! seaice(pctsrf_sic) from coupler 238 ! Receive ocean temperature(tsurf_cpl) and albedo(alb_new) from coupler 281 239 ! 282 240 !**************************************************************************************** 283 241 284 242 CALL cpl_receive_seaice_fields(knon, knindex, & 285 tsurf_cpl, alb_cpl , pctsrf_sic)243 tsurf_cpl, alb_cpl) 286 244 287 245 alb1_new(1:knon) = alb_cpl(1:knon) … … 308 266 CALL calcul_wind_flux(knon, dtime, taux, tauy) 309 267 310 !**************************************************************************************** 311 ! Flux ocean-atmosphere useful for "slab" ocean but here calculated only for printing 312 ! usage later in physiq 313 ! 314 ! IM: faire dependre le coefficient de conduction de la glace de mer 315 ! de l'epaisseur de la glace de mer, dans l'hypothese ou le coeff. 316 ! actuel correspond a 3m de glace de mer, cf. L.Li 317 ! 318 !**************************************************************************************** 319 tmp_flux_g(:) = 0.0 320 DO i = 1, knon 321 IF (cal(i) .GT. 1.0e-15 .AND. pctsrf_sic(knindex(i)) .GT. epsfra) & 322 tmp_flux_g(knindex(i)) = (tsurf_new(i)-t_grnd) * & 323 dif_grnd(i) * RCPD/cal(i) 324 ENDDO 325 268 326 269 !**************************************************************************************** 327 270 ! Calculate fder : flux derivative (sensible and latente) … … 344 287 345 288 CALL cpl_send_seaice_fields(itime, dtime, knon, knindex, & 346 pctsrf _in, lafin, rlon, rlat, &289 pctsrf, lafin, rlon, rlat, & 347 290 swnet, lwnet, fluxlat, fluxsens, & 348 291 precip_rain, precip_snow, evap, tsurf_new, fder_new, alb1, taux, tauy) … … 353 296 !**************************************************************************************** 354 297 ! 355 SUBROUTINE ocean_cpl_get_vars(flux_o, flux_g)356 357 ! This subroutine returns variables private in this module to an external358 ! routine (physiq).359 360 REAL, DIMENSION(klon), INTENT(OUT) :: flux_o361 REAL, DIMENSION(klon), INTENT(OUT) :: flux_g362 363 ! Set the output variables364 flux_o(:) = tmp_flux_o(:)365 flux_g(:) = tmp_flux_g(:)366 367 END SUBROUTINE ocean_cpl_get_vars368 !369 !****************************************************************************************370 !371 298 END MODULE ocean_cpl_mod -
LMDZ4/trunk/libf/phylmd/ocean_forced_mod.F90
r888 r996 14 14 IMPLICIT NONE 15 15 16 REAL, ALLOCATABLE, DIMENSION(:), SAVE, PRIVATE :: tmp_flux_o, tmp_flux_g17 !$OMP THREADPRIVATE(tmp_flux_o,tmp_flux_g)18 19 16 CONTAINS 20 !21 !****************************************************************************************22 !23 SUBROUTINE ocean_forced_init24 ! Allocate fields needed for this module25 !26 INTEGER :: error27 CHARACTER (len = 80) :: abort_message28 CHARACTER (len = 20) :: modname = 'ocean_forced_init'29 !****************************************************************************************30 31 ALLOCATE(tmp_flux_o(1:klon), stat = error)32 IF (error /= 0) THEN33 abort_message='Pb allocation tmp_flux_o'34 CALL abort_gcm(modname,abort_message,1)35 ENDIF36 37 ALLOCATE(tmp_flux_g(1:klon), stat = error)38 IF (error /= 0) THEN39 abort_message='Pb allocation tmp_flux_g'40 CALL abort_gcm(modname,abort_message,1)41 ENDIF42 43 44 END SUBROUTINE ocean_forced_init45 !46 !****************************************************************************************47 !****************************************************************************************48 !49 SUBROUTINE ocean_forced_final50 ! Allocate fields needed for this module51 !52 INTEGER :: error53 CHARACTER (len = 80) :: abort_message54 CHARACTER (len = 20) :: modname = 'ocean_forced_init'55 !****************************************************************************************56 57 DEALLOCATE(tmp_flux_o)58 DEALLOCATE(tmp_flux_g)59 60 61 END SUBROUTINE ocean_forced_final62 17 ! 63 18 !**************************************************************************************** … … 71 26 radsol, snow, agesno, & 72 27 qsurf, evap, fluxsens, fluxlat, & 73 tsurf_new, dflux_s, dflux_l , pctsrf_oce)28 tsurf_new, dflux_s, dflux_l) 74 29 ! 75 30 ! This subroutine treats the "open ocean", all grid points that are not entierly covered 76 31 ! by ice. 77 ! The routine re ads data from climatologie fileand does some calculations at the32 ! The routine receives data from climatologie file limit.nc and does some calculations at the 78 33 ! surface. 79 34 ! 35 USE limit_read_mod 80 36 INCLUDE "indicesol.h" 81 37 INCLUDE "YOMCST.h" … … 108 64 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new 109 65 REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l 110 REAL, DIMENSION(klon), INTENT(OUT) :: pctsrf_oce111 66 112 67 ! Local variables … … 116 71 REAL, DIMENSION(klon) :: alb_neig, tsurf_lim, zx_sl 117 72 LOGICAL :: check=.FALSE. 118 REAL, DIMENSION(klon,nbsrf) :: pctsrf_lim119 73 120 74 !**************************************************************************************** … … 125 79 !**************************************************************************************** 126 80 ! 1) 127 ! Read from climatologie file SST and fraction of sub-surfaces 128 ! 129 !**************************************************************************************** 130 ! Get from file tsurf_lim and pctsrf_lim 131 CALL interfoce_lim(itime, dtime, jour, & 132 knon, knindex, & 133 debut, & 134 tsurf_lim, pctsrf_lim) 135 81 ! Read sea-surface temperature from file limit.nc 82 ! 83 !**************************************************************************************** 84 CALL limit_read_sst(knon,knindex,tsurf_lim) 85 136 86 !**************************************************************************************** 137 87 ! 2) … … 154 104 tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l) 155 105 156 !****************************************************************************************157 ! 3)158 ! Calculate tmp_flux_o159 !160 !****************************************************************************************161 !IM: flux ocean-atmosphere utile pour le "slab" ocean162 ! The flux are written to hist file163 tmp_flux_o(:) = 0.0164 DO i=1, knon165 zx_sl(i) = RLVTT166 IF (tsurf_new(i) .LT. RTT) zx_sl(i) = RLSTT167 168 !IM flux_o(i) = fluxsens(i)-evap(i)*zx_sl(i)169 ! flux_o(i) = fluxsens(i) + fluxlat(i)170 IF (pctsrf_lim(knindex(i),is_oce) .GT. epsfra) THEN171 tmp_flux_o(knindex(i)) = fluxsens(i) + fluxlat(i)172 ENDIF173 ENDDO174 175 !****************************************************************************************176 ! 4)177 ! Return the new values for the ocean fraction178 !179 !****************************************************************************************180 181 pctsrf_oce(:) = pctsrf_lim(:,is_oce)182 106 183 107 END SUBROUTINE ocean_forced_noice … … 192 116 radsol, snow, qsol, agesno, tsoil, & 193 117 qsurf, alb1_new, alb2_new, evap, fluxsens, fluxlat, & 194 tsurf_new, dflux_s, dflux_l , pctsrf_sic)118 tsurf_new, dflux_s, dflux_l) 195 119 ! 196 120 ! This subroutine treats the ocean where there is ice. 197 121 ! The routine reads data from climatologie file and does flux calculations at the 198 122 ! surface. 199 ! 123 ! 124 USE limit_read_mod 125 200 126 INCLUDE "indicesol.h" 201 127 INCLUDE "dimsoil.h" … … 219 145 REAL, DIMENSION(klon), INTENT(IN) :: u1_lay, v1_lay 220 146 221 222 147 ! In/Output arguments 223 148 !**************************************************************************************** … … 226 151 REAL, DIMENSION(klon), INTENT(INOUT) :: agesno 227 152 REAL, DIMENSION(klon, nsoilmx), INTENT(INOUT) :: tsoil 228 229 153 230 154 ! Output arguments … … 236 160 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new 237 161 REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l 238 REAL, DIMENSION(klon), INTENT(OUT) :: pctsrf_sic239 240 162 241 163 ! Local variables … … 248 170 REAL, DIMENSION(klon) :: alb_neig, tsurf_tmp 249 171 REAL, DIMENSION(klon) :: soilcap, soilflux 250 REAL, DIMENSION(klon,nbsrf) :: pctsrf_lim251 172 252 173 !**************************************************************************************** … … 256 177 257 178 !**************************************************************************************** 258 ! 1) 259 ! Read from climatologie file SST and fraction of sub-surfaces 260 ! 261 !**************************************************************************************** 262 CALL interfoce_lim(itime, dtime, jour, & 263 knon, knindex, & 264 debut, & 265 tsurf_tmp, pctsrf_lim) 266 267 DO i = 1, knon 268 tsurf_tmp(i) = tsurf_in(i) 269 IF (pctsrf_lim(knindex(i),is_sic) < EPSFRA) THEN 270 snow(i) = 0.0 271 tsurf_tmp(i) = RTT - 1.8 272 IF (soil_model) tsoil(i,:) = RTT -1.8 273 ENDIF 274 ENDDO 275 276 !**************************************************************************************** 277 ! 2) 179 ! 1) 278 180 ! Flux calculation : tsurf_new, evap, fluxlat, fluxsens, 279 181 ! dflux_s, dflux_l and qsurf 280 182 !**************************************************************************************** 183 tsurf_tmp(:) = tsurf_in(:) 281 184 282 185 ! calculate the parameters cal, beta, capsol and dif_grnd 283 284 186 CALL calbeta(dtime, is_sic, knon, snow, qsol, beta, capsol, dif_grnd) 187 285 188 286 189 IF (soil_model) THEN 287 190 ! update tsoil and calculate soilcap and soilflux 288 CALL soil(dtime, is_sic, knon, snow, tsurf_tmp, tsoil,soilcap, soilflux)191 CALL soil(dtime, is_sic, knon, snow, tsurf_tmp, tsoil,soilcap, soilflux) 289 192 cal(1:knon) = RCPD / soilcap(1:knon) 290 193 radsol(1:knon) = radsol(1:knon) + soilflux(1:knon) … … 305 208 306 209 !**************************************************************************************** 307 ! 3)210 ! 2) 308 211 ! Calculations due to snow and runoff 309 212 ! … … 327 230 alb2_new(:) = alb1_new(:) 328 231 329 !****************************************************************************************330 ! 4)331 ! Calculate tmp_flux_g332 !333 !****************************************************************************************334 !335 tmp_flux_g(:) = 0.0336 DO i = 1, knon337 !IM: faire dependre le coefficient de conduction de la glace de mer338 ! de l'epaisseur de la glace de mer, dans l'hypothese ou le coeff.339 ! actuel correspond a 3m de glace de mer, cf. L.Li340 !341 IF (cal(i) .GT. 1.0e-15 .AND. pctsrf_lim(knindex(i),is_sic) .GT. epsfra) &342 tmp_flux_g(knindex(i)) = (tsurf_new(i)-t_grnd) * dif_grnd(i) *RCPD/cal(i)343 344 ENDDO345 346 347 !****************************************************************************************348 ! 5)349 ! Return the new values for the seaice fraction350 !351 !****************************************************************************************352 353 pctsrf_sic(:) = pctsrf_lim(:,is_sic)354 355 232 END SUBROUTINE ocean_forced_ice 356 233 ! 357 234 !**************************************************************************************** 358 235 ! 359 SUBROUTINE ocean_forced_get_vars(flux_o, flux_g)360 ! Get some variables from module oceanforced.361 ! This subroutine returns variables to a external routine362 363 REAL, DIMENSION(klon), INTENT(OUT) :: flux_o364 REAL, DIMENSION(klon), INTENT(OUT) :: flux_g365 366 ! Initialize the output variables367 flux_o(:) = tmp_flux_o(:)368 flux_g(:) = tmp_flux_g(:)369 370 END SUBROUTINE ocean_forced_get_vars371 !372 !****************************************************************************************373 !374 236 END MODULE ocean_forced_mod 375 237 -
LMDZ4/trunk/libf/phylmd/ocean_slab_mod.F90
r888 r996 7 7 ! "ocean=slab". 8 8 ! 9 USE surface_data , ONLY : tau_gl, calice, calsno9 USE surface_data 10 10 USE fonte_neige_mod, ONLY : fonte_neige 11 11 USE calcul_fluxs_mod, ONLY : calcul_fluxs … … 13 13 14 14 IMPLICIT NONE 15 16 INTEGER, PRIVATE, SAVE :: lmt_pas, julien, idayvrai 17 !$OMP THREADPRIVATE(lmt_pas,julien,idayvrai) 18 REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE :: tmp_seaice 19 !$OMP THREADPRIVATE(tmp_seaice) 20 REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE :: tmp_tslab_loc 21 !$OMP THREADPRIVATE(tmp_tslab_loc) 22 REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE :: slab_bils 23 !$OMP THREADPRIVATE(slab_bils) 24 REAL, ALLOCATABLE, DIMENSION(:), PRIVATE , SAVE :: lmt_bils 25 !$OMP THREADPRIVATE(lmt_bils) 26 REAL, ALLOCATABLE, DIMENSION(:,:), PRIVATE, SAVE :: tmp_pctsrf_slab 27 !$OMP THREADPRIVATE(tmp_pctsrf_slab) 28 REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE :: tmp_tslab 29 !$OMP THREADPRIVATE(tmp_tslab) 30 REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE :: tmp_radsol 31 !$OMP THREADPRIVATE(tmp_radsol) 32 REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE :: tmp_flux_o, tmp_flux_g 33 !$OMP THREADPRIVATE(tmp_flux_o,tmp_flux_g) 34 LOGICAL, PRIVATE, SAVE :: check = .FALSE. 35 !$OMP THREADPRIVATE(check) 15 PRIVATE 16 PUBLIC :: ocean_slab_frac, ocean_slab_noice 36 17 37 18 CONTAINS … … 39 20 !**************************************************************************************** 40 21 ! 41 SUBROUTINE ocean_slab_ init(dtime, tslab_rst, seaice_rst, pctsrf_rst)22 SUBROUTINE ocean_slab_frac(itime, dtime, jour, pctsrf, is_modified) 42 23 24 USE limit_read_mod 43 25 INCLUDE "indicesol.h" 44 INCLUDE "iniprint.h"26 ! INCLUDE "clesphys.h" 45 27 46 ! Input variables28 ! Arguments 47 29 !**************************************************************************************** 48 REAL, INTENT(IN) :: dtime 49 ! Variables read from restart file 50 REAL, DIMENSION(klon), INTENT(IN) :: tslab_rst 51 REAL, DIMENSION(klon), INTENT(IN) :: seaice_rst 52 REAL, DIMENSION(klon, nbsrf), INTENT(IN) :: pctsrf_rst 53 30 INTEGER, INTENT(IN) :: itime ! numero du pas de temps courant 31 INTEGER, INTENT(IN) :: jour ! jour a lire dans l'annee 32 REAL , INTENT(IN) :: dtime ! pas de temps de la physique (en s) 33 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: pctsrf ! sub-surface fraction 34 LOGICAL, INTENT(OUT) :: is_modified ! true if pctsrf is modified at this time step 54 35 55 36 ! Local variables 56 37 !**************************************************************************************** 57 INTEGER :: error58 38 CHARACTER (len = 80) :: abort_message 59 CHARACTER (len = 20) :: modname = 'ocean_slab_ intit'39 CHARACTER (len = 20) :: modname = 'ocean_slab_frac' 60 40 61 41 62 WRITE(lunout,*) '************************' 63 WRITE(lunout,*) 'SLAB OCEAN est actif, prenez precautions !' 64 WRITE(lunout,*) '************************' 42 IF (version_ocean=='sicOBS') THEN 43 CALL limit_read_frac(itime, dtime, jour, pctsrf, is_modified) 44 ELSE 45 abort_message='Ocean slab model without forced sea-ice fractions has to be rewritten!!!' 46 CALL abort_gcm(modname,abort_message,1) 47 ! Here should sea-ice/ocean fraction either be calculated or returned if saved as a module varaiable 48 ! (in the case the new fractions are calculated in ocean_slab_ice or ocean_slab_noice subroutines). 49 END IF 65 50 66 ! Allocate variables initialize from restart fields 67 ALLOCATE(tmp_tslab(klon), stat = error) 68 IF (error /= 0) THEN 69 abort_message='Pb allocation tmp_tslab' 70 CALL abort_gcm(modname,abort_message,1) 71 ENDIF 72 tmp_tslab(:) = tslab_rst(:) 73 74 ALLOCATE(tmp_tslab_loc(klon), stat = error) 75 IF (error /= 0) THEN 76 abort_message='Pb allocation tmp_tslab_loc' 77 CALL abort_gcm(modname,abort_message,1) 78 ENDIF 79 tmp_tslab_loc(:) = tslab_rst(:) 80 81 ALLOCATE(tmp_seaice(klon), stat = error) 82 IF (error /= 0) THEN 83 abort_message='Pb allocation tmp_seaice' 84 CALL abort_gcm(modname,abort_message,1) 85 ENDIF 86 tmp_seaice(:) = seaice_rst(:) 87 88 ALLOCATE(tmp_pctsrf_slab(klon,nbsrf), stat = error) 89 IF (error /= 0) THEN 90 abort_message='Pb allocation tmp_pctsrf_slab' 91 CALL abort_gcm(modname,abort_message,1) 92 ENDIF 93 tmp_pctsrf_slab(:,:) = pctsrf_rst(:,:) 94 95 ! Allocate some other variables internal in module mod_oceanslab 96 ALLOCATE(tmp_radsol(klon), stat = error) 97 IF (error /= 0) THEN 98 abort_message='Pb allocation tmp_radsol' 99 CALL abort_gcm(modname,abort_message,1) 100 ENDIF 101 102 ALLOCATE(tmp_flux_o(klon), stat = error) 103 IF (error /= 0) THEN 104 abort_message='Pb allocation tmp_flux_o' 105 CALL abort_gcm(modname,abort_message,1) 106 ENDIF 107 108 ALLOCATE(tmp_flux_g(klon), stat = error) 109 IF (error /= 0) THEN 110 abort_message='Pb allocation tmp_flux_g' 111 CALL abort_gcm(modname,abort_message,1) 112 ENDIF 113 114 ! a mettre un slab_bils aussi en force !!! 115 ALLOCATE(slab_bils(klon), stat = error) 116 IF (error /= 0) THEN 117 abort_message='Pb allocation slab_bils' 118 CALL abort_gcm(modname,abort_message,1) 119 ENDIF 120 slab_bils(:) = 0.0 121 122 ALLOCATE(lmt_bils(klon), stat = error) 123 IF (error /= 0) THEN 124 abort_message='Pb allocation lmt_bils' 125 CALL abort_gcm(modname,abort_message,1) 126 ENDIF 127 128 129 ! pour une lecture une fois par jour 130 lmt_pas = NINT(86400./dtime * 1.0) 131 132 END SUBROUTINE ocean_slab_init 51 END SUBROUTINE ocean_slab_frac 133 52 ! 134 53 !**************************************************************************************** 135 54 ! 136 55 SUBROUTINE ocean_slab_noice( & 137 dtime, knon, knindex, &56 itime, dtime, jour, knon, knindex, & 138 57 p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum, & 139 58 petAcoef, peqAcoef, petBcoef, peqBcoef, & 140 ps, u1_lay, v1_lay, &59 ps, u1_lay, v1_lay, tsurf_in, & 141 60 radsol, snow, agesno, & 142 61 qsurf, evap, fluxsens, fluxlat, & 143 tsurf_new, dflux_s, dflux_l, pctsrf_oce)62 tsurf_new, dflux_s, dflux_l, lmt_bils) 144 63 145 64 INCLUDE "indicesol.h" … … 148 67 ! Input arguments 149 68 !**************************************************************************************** 69 INTEGER, INTENT(IN) :: itime 70 INTEGER, INTENT(IN) :: jour 150 71 INTEGER, INTENT(IN) :: knon 151 72 INTEGER, DIMENSION(klon), INTENT(IN) :: knindex … … 159 80 REAL, DIMENSION(klon), INTENT(IN) :: ps 160 81 REAL, DIMENSION(klon), INTENT(IN) :: u1_lay, v1_lay 82 REAL, DIMENSION(klon), INTENT(IN) :: tsurf_in 161 83 162 84 ! In/Output arguments … … 172 94 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new 173 95 REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l 174 REAL, DIMENSION(klon), INTENT(OUT) :: pctsrf_oce96 REAL, DIMENSION(klon), INTENT(OUT) :: lmt_bils 175 97 176 98 ! Local variables 177 99 !**************************************************************************************** 178 INTEGER :: i 179 REAL, DIMENSION(klon) :: cal, beta, dif_grnd 180 REAL, DIMENSION(klon) :: tsurf_temp 100 INTEGER :: i 101 REAL, DIMENSION(klon) :: cal, beta, dif_grnd 102 REAL, DIMENSION(klon) :: lmt_bils_oce, lmt_foce, diff_sst 103 REAL :: calc_bils_oce, deltat 104 REAL, PARAMETER :: cyang=50.0 * 4.228e+06 ! capacite calorifique volumetrique de l'eau J/(m2 K) 181 105 182 106 !**************************************************************************************** 183 IF (check) WRITE(*,*)' Entering ocean_slab_noice' 184 185 tsurf_new(1:knon) = tmp_tslab(knindex(1:knon)) 186 pctsrf_oce(:) = tmp_pctsrf_slab(:,is_oce) 187 188 tsurf_temp(:) = tsurf_new(:) 189 cal = 0. 190 beta = 1. 191 dif_grnd = 0. 192 agesno(:) = 0. 107 ! 1) Flux calculation 108 ! 109 !**************************************************************************************** 110 cal(:) = 0. 111 beta(:) = 1. 112 dif_grnd(:) = 0. 113 agesno(:) = 0. 193 114 194 115 CALL calcul_fluxs(knon, is_oce, dtime, & 195 tsurf_ temp, p1lay, cal, beta, tq_cdrag, ps, &116 tsurf_in, p1lay, cal, beta, tq_cdrag, ps, & 196 117 precip_rain, precip_snow, snow, qsurf, & 197 118 radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, & 198 119 petAcoef, peqAcoef, petBcoef, peqBcoef, & 199 120 tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l) 200 201 tmp_flux_o(:) = 0.0202 tmp_radsol(:) = 0.0203 121 204 DO i=1, knon 205 tmp_radsol(knindex(i))=radsol(i) 206 207 IF (pctsrf_oce(knindex(i)) .GT. epsfra) & 208 tmp_flux_o(knindex(i)) = fluxsens(i) + fluxlat(i) 209 ENDDO 210 122 !**************************************************************************************** 123 ! 2) Get global variables lmt_bils and lmt_foce from file limit_slab.nc 124 ! 125 !**************************************************************************************** 126 CALL limit_slab(itime, dtime, jour, lmt_bils, lmt_foce, diff_sst) ! global pour un processus 127 128 lmt_bils_oce(:) = 0. 129 WHERE (lmt_foce > 0.) 130 lmt_bils_oce = lmt_bils / lmt_foce ! global 131 END WHERE 132 133 !**************************************************************************************** 134 ! 3) Recalculate new temperature 135 ! 136 !**************************************************************************************** 137 DO i = 1, knon 138 calc_bils_oce = radsol(i) + fluxsens(i) + fluxlat(i) 139 deltat = (calc_bils_oce - lmt_bils_oce(knindex(i)))*dtime/cyang +diff_sst(knindex(i)) 140 tsurf_new(i) = tsurf_in(i) + deltat 141 END DO 142 211 143 END SUBROUTINE ocean_slab_noice 212 144 ! 213 145 !**************************************************************************************** 214 146 ! 215 SUBROUTINE ocean_slab_ice( &216 itime, dtime, jour, knon, knindex, &217 debut, &218 tsurf, p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum, &219 petAcoef, peqAcoef, petBcoef, peqBcoef, &220 ps, u1_lay, v1_lay, &221 radsol, snow, qsurf, qsol, agesno, tsoil, &222 alb1_new, alb2_new, evap, fluxsens, fluxlat, &223 tsurf_new, dflux_s, dflux_l, pctsrf_sic)224 225 INCLUDE "indicesol.h"226 INCLUDE "dimsoil.h"227 INCLUDE "YOMCST.h"228 INCLUDE "iniprint.h"229 INCLUDE "clesphys.h"230 231 ! Input arguments232 !****************************************************************************************233 INTEGER, INTENT(IN) :: itime, jour, knon234 INTEGER, DIMENSION(klon), INTENT(IN) :: knindex235 REAL, INTENT(IN) :: dtime236 REAL, DIMENSION(klon), INTENT(IN) :: tsurf237 REAL, DIMENSION(klon), INTENT(IN) :: p1lay238 REAL, DIMENSION(klon), INTENT(IN) :: tq_cdrag239 REAL, DIMENSION(klon), INTENT(IN) :: precip_rain, precip_snow240 REAL, DIMENSION(klon), INTENT(IN) :: temp_air, spechum241 REAL, DIMENSION(klon), INTENT(IN) :: petAcoef, peqAcoef242 REAL, DIMENSION(klon), INTENT(IN) :: petBcoef, peqBcoef243 REAL, DIMENSION(klon), INTENT(IN) :: ps244 REAL, DIMENSION(klon), INTENT(IN) :: u1_lay, v1_lay245 LOGICAL, INTENT(IN) :: debut246 247 !In/Output arguments248 !****************************************************************************************249 REAL, DIMENSION(klon), INTENT(INOUT) :: radsol250 REAL, DIMENSION(klon), INTENT(INOUT) :: snow, qsol251 REAL, DIMENSION(klon), INTENT(INOUT) :: agesno252 REAL, DIMENSION(klon, nsoilmx), INTENT(INOUT) :: tsoil253 254 ! Output arguments255 !****************************************************************************************256 REAL, DIMENSION(klon), INTENT(OUT) :: qsurf257 REAL, DIMENSION(klon), INTENT(OUT) :: alb1_new ! new albedo in visible SW interval258 REAL, DIMENSION(klon), INTENT(OUT) :: alb2_new ! new albedo in near IR interval259 REAL, DIMENSION(klon), INTENT(OUT) :: evap, fluxsens, fluxlat260 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new261 REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l262 REAL, DIMENSION(klon), INTENT(OUT) :: pctsrf_sic263 264 ! Local variables265 !****************************************************************************************266 INTEGER :: i267 REAL, DIMENSION(klon) :: cal, beta, dif_grnd, capsol268 REAL, DIMENSION(klon) :: alb_neig, tsurf_temp269 REAL, DIMENSION(klon) :: soilcap, soilflux270 REAL, DIMENSION(klon) :: zfra271 REAL, PARAMETER :: t_grnd=271.35272 REAL :: amn, amx273 REAL, DIMENSION(klon) :: tslab274 REAL, DIMENSION(klon) :: seaice ! glace de mer (kg/m2)275 REAL, DIMENSION(klon,nbsrf) :: pctsrf_new276 277 !****************************************************************************************278 279 IF (check) WRITE(*,*)'Entering surface_seaice, knon=',knon280 281 ! Initialization of output variables282 alb1_new(:) = 0.0283 284 !****************************************************************************************285 !286 !287 !****************************************************************************************288 IF ( ok_slab_sicOBS) THEN289 ! glace de mer observee, lecture conditions limites290 CALL interfoce_lim(itime, dtime, jour, &291 knon, knindex, &292 debut, &293 tsurf_new, pctsrf_new)294 295 tmp_pctsrf_slab(:,:) = pctsrf_new(:,:)296 WRITE(lunout,*) 'jour lecture pctsrf_new sic =',jour297 298 ELSE299 pctsrf_new=tmp_pctsrf_slab300 ENDIF301 302 DO i = 1, knon303 tsurf_new(i) = tsurf(i)304 IF (pctsrf_new(knindex(i),is_sic) < EPSFRA) THEN305 snow(i) = 0.0306 tsurf_new(i) = RTT - 1.8307 IF (soil_model) tsoil(i,:) = RTT -1.8308 ENDIF309 ENDDO310 311 CALL calbeta(dtime, is_sic, knon, snow, qsol, beta, capsol, dif_grnd)312 313 IF (soil_model) THEN314 CALL soil(dtime, is_sic, knon, snow, tsurf_new, tsoil, soilcap, soilflux)315 cal(1:knon) = RCPD / soilcap(1:knon)316 radsol(1:knon) = radsol(1:knon) + soilflux(1:knon)317 ELSE318 dif_grnd = 1.0 / tau_gl319 cal = RCPD * calice320 WHERE (snow > 0.0) cal = RCPD * calsno321 ENDIF322 tsurf_temp = tsurf_new323 beta = 1.0324 325 !****************************************************************************************326 !327 !328 !****************************************************************************************329 CALL calcul_fluxs(knon, is_sic, dtime, &330 tsurf_temp, p1lay, cal, beta, tq_cdrag, ps, &331 precip_rain, precip_snow, snow, qsurf, &332 radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, &333 petAcoef, peqAcoef, petBcoef, peqBcoef, &334 tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)335 336 CALL fonte_neige( knon, is_sic, knindex, dtime, &337 tsurf_temp, precip_rain, precip_snow, &338 snow, qsol, tsurf_new, evap)339 340 !****************************************************************************************341 ! calcul albedo342 !343 !****************************************************************************************344 CALL albsno(klon,knon,dtime,agesno(:),alb_neig(:), precip_snow(:))345 WHERE (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0.346 zfra(1:knon) = MAX(0.0,MIN(1.0,snow(1:knon)/(snow(1:knon)+10.0)))347 alb1_new(1 : knon) = alb_neig(1 : knon) *zfra(1:knon) + &348 0.6 * (1.0-zfra(1:knon))349 350 alb2_new(:) = alb1_new(:)351 352 !353 !IM: flux entre l'ocean et la glace de mer pour le "slab" ocean354 tmp_flux_g(:) = 0.0355 DO i = 1, knon356 !357 !IM: faire dependre le coefficient de conduction de la glace de mer358 ! de l'epaisseur de la glace de mer, dans l'hypothese ou le coeff.359 ! actuel correspond a 3m de glace de mer, cf. L.Li360 !361 IF ((cal(i).GT.1.0e-15) .AND. (pctsrf_new(knindex(i),is_sic) .GT. epsfra)) THEN362 tmp_flux_g(knindex(i))=(tsurf_new(i)-t_grnd) &363 * dif_grnd(i) *RCPD/cal(i)364 ENDIF365 !366 !IM: Attention: ne pas initialiser le tmp_radsol puisque c'est deja fait sur is_oce;367 !IM: tmp_radsol doit etre le flux solaire qui arrive sur l'ocean368 !IM: et non pas celui qui arrive sur la glace de mer369 ENDDO370 371 !372 ! 2eme appel a interfoce pour le cumul et le passage des flux a l'ocean373 !374 375 IF (check) THEN376 amn=MIN(tmp_tslab(1),1000.)377 amx=MAX(tmp_tslab(1),-1000.)378 DO i=2, klon379 amn=MIN(tmp_tslab(i),amn)380 amx=MAX(tmp_tslab(i),amx)381 ENDDO382 383 WRITE(lunout,*) ' debut avant interfoce_slab min max tmp_tslab',amn,amx384 ENDIF !(check) THEN385 386 tslab = tmp_tslab387 388 CALL interfoce_slab(klon, debut, itime, dtime, jour, &389 tmp_radsol, tmp_flux_o, tmp_flux_g, tmp_pctsrf_slab, &390 tslab, seaice, pctsrf_new)391 392 tmp_pctsrf_slab=pctsrf_new393 394 DO i=1, knon395 tmp_tslab(knindex(i))=tslab(knindex(i))396 ENDDO397 398 399 !****************************************************************************************400 ! Return the fraction of sea-ice401 ! NB! jg : Peut-etre un probleme, faut-il prend aussi tmp_pctsrf_slab(:,is_oce)???402 !****************************************************************************************403 pctsrf_sic(:) = tmp_pctsrf_slab(:,is_sic)404 405 406 END SUBROUTINE ocean_slab_ice407 !408 !****************************************************************************************409 !410 SUBROUTINE interfoce_slab(klon, debut, itap, dtime, ijour, &411 radsol, fluxo, fluxg, pctsrf, &412 tslab, seaice, pctsrf_slab)413 !414 ! Cette routine calcule la temperature d'un slab ocean, la glace de mer415 ! et les pourcentages de la maille couverte par l'ocean libre et/ou416 ! la glace de mer pour un "slab" ocean de 50m417 !418 ! Conception: Laurent Li419 ! Re-ecriture + adaptation LMDZ4: I. Musat420 !421 ! input:422 ! klon nombre total de points de grille423 ! debut logical: 1er appel a la physique424 ! itap numero du pas de temps425 ! dtime pas de temps de la physique (en s)426 ! ijour jour dans l'annee en cours427 ! radsol rayonnement net au sol (LW + SW)428 ! fluxo flux turbulent (sensible + latent) sur les mailles oceaniques429 ! fluxg flux de conduction entre la surface de la glace de mer et l'ocean430 ! pctsrf tableau des pourcentages de surface de chaque maille431 ! output:432 ! tslab temperature de l'ocean libre433 ! seaice glace de mer (kg/m2)434 ! pctsrf_slab "pourcentages" (valeurs entre 0. et 1.) surfaces issus du slab435 436 INCLUDE "indicesol.h"437 INCLUDE "YOMCST.h"438 INCLUDE "iniprint.h"439 INCLUDE "clesphys.h"440 441 ! Input arguments442 !****************************************************************************************443 INTEGER, INTENT(IN) :: klon444 LOGICAL, INTENT(IN) :: debut ! not used445 INTEGER, INTENT(IN) :: itap446 REAL, INTENT(IN) :: dtime ! not used447 INTEGER, INTENT(IN) :: ijour448 REAL, DIMENSION(klon), INTENT(IN) :: radsol449 REAL, DIMENSION(klon), INTENT(IN) :: fluxo450 REAL, DIMENSION(klon), INTENT(IN) :: fluxg451 REAL, DIMENSION(klon, nbsrf), INTENT(IN) :: pctsrf452 453 ! Output arguments454 !****************************************************************************************455 REAL, DIMENSION(klon), INTENT(OUT) :: tslab456 REAL, DIMENSION(klon), INTENT(OUT) :: seaice ! glace de mer (kg/m2)457 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: pctsrf_slab458 459 ! Local variables460 !****************************************************************************************461 REAL :: amn, amx462 REAL, PARAMETER :: unjour=86400.463 REAL, PARAMETER :: cyang=50.0 * 4.228e+06 ! capacite calorifique volumetrique de l'eau J/(m2 K)464 REAL, PARAMETER :: cbing=0.334e+05 ! J/kg465 REAL, DIMENSION(klon) :: siceh !hauteur de la glace de mer (m)466 INTEGER :: i467 REAL :: zz, za, zb468 !469 !****************************************************************************************470 !471 julien = MOD(ijour,360)472 473 IF (check ) THEN474 amn=MIN(tmp_tslab_loc(1),1000.)475 amx=MAX(tmp_tslab_loc(1),-1000.)476 DO i=2, klon477 amn=MIN(tmp_tslab_loc(i),amn)478 amx=MAX(tmp_tslab_loc(i),amx)479 ENDDO480 481 WRITE(lunout,*) ' debut min max tslab',amn,amx482 WRITE(lunout,*) ' itap,lmt_pas unjour',itap,lmt_pas,unjour483 ENDIF484 485 pctsrf_slab(1:klon,1:nbsrf) = pctsrf(1:klon,1:nbsrf)486 !487 ! lecture du bilan au sol lmt_bils issu d'une simulation forcee en debut de journee488 !489 IF (MOD(itap,lmt_pas) .EQ. 1) THEN490 ! 1er pas de temps de la journee491 idayvrai = ijour492 CALL condsurf(julien,idayvrai, lmt_bils)493 ENDIF494 495 DO i = 1, klon496 IF((pctsrf_slab(i,is_oce).GT.epsfra).OR. &497 (pctsrf_slab(i,is_sic).GT.epsfra)) THEN498 !499 ! fabriquer de la glace si congelation atteinte:500 !501 IF (tmp_tslab_loc(i).LT.(RTT-1.8)) THEN502 zz = (RTT-1.8)-tmp_tslab_loc(i)503 tmp_seaice(i) = tmp_seaice(i) + cyang/cbing * zz504 seaice(i) = tmp_seaice(i)505 tmp_tslab_loc(i) = RTT-1.8506 ENDIF507 !508 ! faire fondre de la glace si temperature est superieure a 0:509 !510 IF ((tmp_tslab_loc(i).GT.RTT) .AND. (tmp_seaice(i).GT.0.0)) THEN511 zz = cyang/cbing * (tmp_tslab_loc(i)-RTT)512 zz = MIN(zz,tmp_seaice(i))513 tmp_seaice(i) = tmp_seaice(i) - zz514 seaice(i) = tmp_seaice(i)515 tmp_tslab_loc(i) = tmp_tslab_loc(i) - zz*cbing/cyang516 ENDIF517 !518 ! limiter la glace de mer a 10 metres (10000 kg/m2)519 !520 IF(tmp_seaice(i).GT.45.) THEN521 tmp_seaice(i) = MIN(tmp_seaice(i),10000.0)522 ELSE523 tmp_seaice(i) = 0.524 ENDIF525 seaice(i) = tmp_seaice(i)526 siceh(i)=tmp_seaice(i)/1000. !en metres527 !528 ! determiner la nature du sol (glace de mer ou ocean libre):529 !530 ! on fait dependre la fraction de seaice "pctsrf(i,is_sic)"531 ! de l'epaisseur de seaice :532 ! pctsrf(i,is_sic)=1. si l'epaisseur de la glace de mer est >= a 20cm533 ! et pctsrf(i,is_sic) croit lineairement avec seaice de 0. a 20cm d'epaisseur534 !535 536 IF(.NOT.ok_slab_sicOBS) THEN537 pctsrf_slab(i,is_sic)=MIN(siceh(i)/0.20, &538 1.-(pctsrf_slab(i,is_ter)+pctsrf_slab(i,is_lic)))539 pctsrf_slab(i,is_oce)=1.0 - &540 (pctsrf_slab(i,is_ter)+pctsrf_slab(i,is_lic)+pctsrf_slab(i,is_sic))541 ELSE542 IF (i.EQ.1) WRITE(lunout,*) 'cas ok_slab_sicOBS TRUE : passe sur la modif.'543 ENDIF !(.NOT.ok_slab_sicOBS) then544 ENDIF !pctsrf545 ENDDO546 !547 ! Calculer le bilan du flux de chaleur au sol :548 !549 DO i = 1, klon550 za = radsol(i) + fluxo(i)551 zb = fluxg(i)552 IF((pctsrf_slab(i,is_oce).GT.epsfra).OR. &553 (pctsrf_slab(i,is_sic).GT.epsfra)) THEN554 slab_bils(i)=slab_bils(i)+(za*pctsrf_slab(i,is_oce) &555 +zb*pctsrf_slab(i,is_sic))/ FLOAT(lmt_pas)556 ENDIF557 ENDDO !klon558 !559 ! calcul tslab560 !561 IF (MOD(itap,lmt_pas).EQ.0) THEN !fin de journee562 !563 ! calcul tslab564 amn=MIN(tmp_tslab_loc(1),1000.)565 amx=MAX(tmp_tslab_loc(1),-1000.)566 DO i = 1, klon567 IF ((pctsrf_slab(i,is_oce).GT.epsfra).OR. &568 (pctsrf_slab(i,is_sic).GT.epsfra)) THEN569 tmp_tslab_loc(i) = tmp_tslab_loc(i) + &570 (slab_bils(i)-lmt_bils(i)) &571 /cyang*unjour572 573 ! on remet l'accumulation a 0574 slab_bils(i) = 0.575 ENDIF !pctsrf576 !577 IF (check) THEN578 IF(i.EQ.1) THEN579 WRITE(lunout,*) 'i tmp_tslab_loc MOD(itap,lmt_pas).EQ.0 sicINTER',i,itap, &580 tmp_tslab_loc(i), tmp_seaice(i)581 ENDIF582 583 amn=MIN(tmp_tslab_loc(i),amn)584 amx=MAX(tmp_tslab_loc(i),amx)585 ENDIF586 ENDDO !klon587 ENDIF !(MOD(itap,lmt_pas).EQ.0) THEN588 589 IF ( check ) THEN590 WRITE(lunout,*) 'fin min max tslab',amn,amx591 ENDIF592 593 tslab = tmp_tslab_loc594 seaice = tmp_seaice595 596 END SUBROUTINE interfoce_slab597 !598 !****************************************************************************************599 !600 SUBROUTINE ocean_slab_final(tslab_rst, seaice_rst)601 602 ! This subroutine will send to phyredem the variables concerning the slab603 ! ocean that should be written to restart file.604 605 !****************************************************************************************606 607 REAL, DIMENSION(klon), INTENT(OUT) :: tslab_rst608 REAL, DIMENSION(klon), INTENT(OUT) :: seaice_rst609 610 !****************************************************************************************611 ! Set the output variables612 tslab_rst(:) = tmp_tslab(:)613 ! tslab_rst(:) = tmp_tslab_loc(:)614 seaice_rst(:) = tmp_seaice(:)615 616 ! Deallocation of all variables in module617 DEALLOCATE(tmp_tslab, tmp_tslab_loc, tmp_pctsrf_slab)618 DEALLOCATE(tmp_seaice, tmp_radsol, tmp_flux_o, tmp_flux_g)619 DEALLOCATE(slab_bils, lmt_bils)620 621 END SUBROUTINE ocean_slab_final622 !623 !****************************************************************************************624 !625 SUBROUTINE ocean_slab_get_vars(tslab_loc, seaice_loc, flux_o_loc, flux_g_loc)626 ! "Get some variables from module ocean_slab_mod"627 ! This subroutine prints variables to a external routine628 629 REAL, DIMENSION(klon), INTENT(OUT) :: tslab_loc630 REAL, DIMENSION(klon), INTENT(OUT) :: seaice_loc631 REAL, DIMENSION(klon), INTENT(OUT) :: flux_o_loc632 REAL, DIMENSION(klon), INTENT(OUT) :: flux_g_loc633 634 ! Set the output variables635 tslab_loc(:) = tmp_tslab(:)636 seaice_loc(:) = tmp_seaice(:)637 flux_o_loc(:) = tmp_flux_o(:)638 flux_g_loc(:) = tmp_flux_g(:)639 640 END SUBROUTINE ocean_slab_get_vars641 !642 !****************************************************************************************643 !644 147 END MODULE ocean_slab_mod -
LMDZ4/trunk/libf/phylmd/pbl_surface_mod.F90
r987 r996 13 13 USE mod_phys_lmdz_para, ONLY : mpi_size 14 14 USE ioipsl 15 USE surface_data, ONLY : ocean, ok_veget15 USE surface_data, ONLY : type_ocean, ok_veget 16 16 USE surf_land_mod, ONLY : surf_land 17 17 USE surf_landice_mod, ONLY : surf_landice … … 151 151 !**************************************************************************************** 152 152 153 IF ( ocean /= 'slab ' .AND. ocean /= 'force ' .AND.ocean /= 'couple') THEN153 IF (type_ocean /= 'slab ' .AND. type_ocean /= 'force ' .AND. type_ocean /= 'couple') THEN 154 154 WRITE(lunout,*)' *** Warning ***' 155 WRITE(lunout,*)'Option couplage pour l''ocean = ', ocean155 WRITE(lunout,*)'Option couplage pour l''ocean = ', type_ocean 156 156 abort_message='option pour l''ocean non valable' 157 157 CALL abort_gcm(modname,abort_message,1) … … 187 187 zxtsol, zxfluxlat, zt2m, qsat2m, & 188 188 d_t, d_q, d_u, d_v, & 189 zcoefh, pctsrf_new,&189 zcoefh, slab_wfbils, & 190 190 qsol_d, zq2m, s_pblh, s_plcl, & 191 191 s_capCL, s_oliqCL, s_cteiCL, s_pblT, & … … 299 299 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: u10m ! u speed at 10m 300 300 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: v10m ! v speed at 10m 301 REAL, DIMENSION(klon, klev+1, nbsrf), INTENT(INOUT) :: tke 301 302 302 303 ! Output variables … … 321 322 REAL, DIMENSION(klon, klev), INTENT(OUT) :: d_v ! change in v speed 322 323 REAL, DIMENSION(klon, klev), INTENT(OUT) :: zcoefh ! coef for turbulent diffusion of T and Q, mean for each grid point 323 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: pctsrf_new ! new sub-surface fraction324 324 325 325 ! Output only for diagnostics 326 REAL, DIMENSION(klon), INTENT(OUT) :: slab_wfbils! heat balance at surface only for slab at ocean points 326 327 REAL, DIMENSION(klon), INTENT(OUT) :: qsol_d ! water height in the soil (mm) 327 328 REAL, DIMENSION(klon), INTENT(OUT) :: zq2m ! water vapour at 2m, mean for each grid point … … 367 368 REAL, DIMENSION(klon, nbsrf),INTENT(OUT) :: q2m ! water vapour at 2 meter height 368 369 REAL, DIMENSION(klon, klev, nbsrf), INTENT(OUT) :: flux_q ! water vapour flux(latent flux) (kg/m**2/s) 369 370 ! Input/output371 REAL, DIMENSION(klon, klev+1, nbsrf), INTENT(INOUT) :: tke372 370 373 371 … … 431 429 REAL, DIMENSION(klon) :: ypsref 432 430 REAL, DIMENSION(klon) :: yevap, ytsurf_new, yalb1_new, yalb2_new 433 REAL, DIMENSION(klon) :: pctsrf_nsrf434 431 REAL, DIMENSION(klon) :: ztsol 435 432 REAL, DIMENSION(klon) :: alb_m ! mean albedo for whole SW interval … … 446 443 REAL, DIMENSION(klon,klev+1) :: ytke 447 444 REAL, DIMENSION(klon,nsoilmx) :: ytsoil 448 REAL, DIMENSION(klon,nbsrf) :: pctsrf_pot449 445 CHARACTER(len=80) :: abort_message 450 446 CHARACTER(len=20) :: modname = 'pbl_surface' … … 470 466 REAL, DIMENSION(klon,nbsrf) :: trmb2 ! inhibition 471 467 REAL, DIMENSION(klon,nbsrf) :: trmb3 ! point Omega 472 REAL, DIMENSION(klon,nbsrf) :: zx_rh2m, zx_qsat2m 473 REAL, DIMENSION(klon,nbsrf) :: zx_qs1, zx_t1 474 REAL, DIMENSION(klon,nbsrf) :: zdelta1, zcor1 468 REAL, DIMENSION(klon,nbsrf) :: zx_t1 475 469 REAL, DIMENSION(klon, nbsrf) :: alb ! mean albedo for whole SW interval 476 470 REAL, DIMENSION(klon) :: ylwdown ! jg : temporary (ysollwdown) 477 471 478 479 !jg+ temporary test 480 REAL, DIMENSION(klon,klev) :: y_flux_u_old, y_flux_v_old 481 REAL, DIMENSION(klon,klev) :: y_d_u_old, y_d_v_old 482 !jg- 483 472 REAL :: zx_qs1, zcor1, zdelta1 473 484 474 !**************************************************************************************** 485 475 ! Declarations specifiques pour le 1D. A reprendre … … 558 548 yv1 = 0.0 ; ypaprs = 0.0 ; ypplay = 0.0 559 549 ydelp = 0.0 ; yu = 0.0 ; yv = 0.0 ; yt = 0.0 560 yq = 0.0 ; pctsrf_new = 0.0 ; y_dflux_t = 0.0; y_dflux_q = 0.0550 yq = 0.0 ; y_dflux_t = 0.0 ; y_dflux_q = 0.0 561 551 yrugoro = 0.0 ; yu10mx = 0.0 ; yu10my = 0.0 ; ywindsp = 0.0 562 552 d_ts = 0.0 ; yfluxlat=0.0 ; flux_t = 0.0 ; flux_q = 0.0 … … 661 651 ! 4) Loop over different surfaces 662 652 ! 663 ! All points with a possibility of the current surface are used. This is done 664 ! to allow the sea-ice to appear or disappear. It is considered here that the 665 ! entier domaine of the ocean possibly can contain sea-ice. 653 ! Only points containing a fraction of the sub surface will be threated. 666 654 ! 667 655 !**************************************************************************************** 668 669 pctsrf_pot = pctsrf 670 pctsrf_pot(:,is_oce) = 1. - zmasq(:) 671 pctsrf_pot(:,is_sic) = 1. - zmasq(:) 672 656 673 657 loop_nbsrf: DO nsrf = 1, nbsrf 674 658 … … 677 661 knon = 0 678 662 DO i = 1, klon 679 IF (pctsrf _pot(i,nsrf).GT.epsfra) THEN663 IF (pctsrf(i,nsrf) > 0.) THEN 680 664 knon = knon + 1 681 665 ni(knon) = i … … 730 714 ypaprs(j,k) = paprs(i,k) 731 715 ypplay(j,k) = pplay(i,k) 732 ydelp(j,k) = delp(i,k)733 ytke(j,k) =tke(i,k,nsrf)716 ydelp(j,k) = delp(i,k) 717 ytke(j,k) = tke(i,k,nsrf) 734 718 yu(j,k) = u(i,k) 735 719 yv(j,k) = v(i,k) … … 762 746 CALL coef_diff_turb(dtime, nsrf, knon, ni, & 763 747 ypaprs, ypplay, yu, yv, yq, yt, yts, yrugos, yqsurf, & 764 ycoefm, ycoefh, ytke)748 ycoefm, ycoefh, ytke) 765 749 766 750 !**************************************************************************************** … … 817 801 ysnow, yqsol, yagesno, ytsoil, & 818 802 yz0_new, yalb1_new, yalb2_new, yevap, yfluxsens, yfluxlat, & 819 yqsurf, ytsurf_new, y_dflux_t, y_dflux_q, pctsrf_nsrf,&803 yqsurf, ytsurf_new, y_dflux_t, y_dflux_q, & 820 804 ylwdown) 821 805 … … 828 812 ysnow, yqsurf, yqsol, yagesno, & 829 813 ytsoil, yz0_new, yalb1_new, yalb2_new, yevap, yfluxsens, yfluxlat, & 830 ytsurf_new, y_dflux_t, y_dflux_q , pctsrf_nsrf)814 ytsurf_new, y_dflux_t, y_dflux_q) 831 815 832 816 CASE(is_oce) 833 817 CALL surf_ocean(rlon, rlat, ysolsw, ysollw, yalb1, & 834 yrugos, ywindsp, rmu0, yfder, &818 yrugos, ywindsp, rmu0, yfder, yts, & 835 819 itap, dtime, jour, knon, ni, & 836 820 debut, & … … 840 824 ysnow, yqsurf, yagesno, & 841 825 yz0_new, yalb1_new, yalb2_new, yevap, yfluxsens, yfluxlat, & 842 ytsurf_new, y_dflux_t, y_dflux_q, pctsrf_nsrf)826 ytsurf_new, y_dflux_t, y_dflux_q, slab_wfbils) 843 827 844 828 CASE(is_sic) … … 852 836 ysnow, yqsurf, yqsol, yagesno, ytsoil, & 853 837 yz0_new, yalb1_new, yalb2_new, yevap, yfluxsens, yfluxlat, & 854 ytsurf_new, y_dflux_t, y_dflux_q , pctsrf_nsrf)838 ytsurf_new, y_dflux_t, y_dflux_q) 855 839 856 840 … … 861 845 END SELECT 862 846 863 !****************************************************************************************864 ! Save the fraction of this sub-surface865 !866 !****************************************************************************************867 pctsrf_new(:,nsrf) = pctsrf_nsrf(:)868 847 869 848 !**************************************************************************************** … … 882 861 !**************************************************************************************** 883 862 ! H and Q 884 ! print *,'pbl_surface: ok_flux_surf=',ok_flux_surf885 ! print *,'pbl_surface: fsens flat RLVTT=',fsens,flat,RLVTT863 ! print *,'pbl_surface: ok_flux_surf=',ok_flux_surf 864 ! print *,'pbl_surface: fsens flat RLVTT=',fsens,flat,RLVTT 886 865 if (ok_flux_surf) then 887 866 y_flux_t1(:) = fsens … … 916 895 !**************************************************************************************** 917 896 918 tke(:,:,nsrf) =0.897 tke(:,:,nsrf) = 0. 919 898 DO k = 1, klev 920 899 DO j = 1, knon … … 922 901 ycoefh(j,k) = ycoefh(j,k) * ypct(j) 923 902 ycoefm(j,k) = ycoefm(j,k) * ypct(j) 924 y_d_t(j,k) = y_d_t(j,k) * ypct(j)925 y_d_q(j,k) = y_d_q(j,k) * ypct(j)926 y_d_u(j,k) = y_d_u(j,k) * ypct(j)927 y_d_v(j,k) = y_d_v(j,k) * ypct(j)903 y_d_t(j,k) = y_d_t(j,k) * ypct(j) 904 y_d_q(j,k) = y_d_q(j,k) * ypct(j) 905 y_d_u(j,k) = y_d_u(j,k) * ypct(j) 906 y_d_v(j,k) = y_d_v(j,k) * ypct(j) 928 907 929 908 flux_t(i,k,nsrf) = y_flux_t(j,k) … … 932 911 flux_v(i,k,nsrf) = y_flux_v(j,k) 933 912 934 tke(i,k,nsrf) =ytke(j,k)913 tke(i,k,nsrf) = ytke(j,k) 935 914 936 915 ENDDO … … 1021 1000 trmb2(:,nsrf) = 0. ! inhibition 1022 1001 trmb3(:,nsrf) = 0. ! Point Omega 1002 rh2m(:) = 0. 1003 qsat2m(:) = 0. 1023 1004 1024 1005 #undef T2m 1025 1006 #define T2m 1026 1007 #ifdef T2m 1027 ! diagnostic t,q a 2m et u, v a10m1008 ! Calculations of diagnostic t,q at 2m and u, v at 10m 1028 1009 1029 1010 DO j=1, knon … … 1055 1036 i = ni(j) 1056 1037 t2m(i,nsrf)=yt2m(j) 1038 q2m(i,nsrf)=yq2m(j) 1057 1039 1058 q2m(i,nsrf)=yq2m(j) 1059 1060 ! u10m, v10m : composantes du vent a 10m sans spirale de Ekman 1040 ! u10m, v10m : composantes du vent a 10m sans spirale de Ekman 1061 1041 u10m(i,nsrf)=(yu10m(j) * uzon(j))/SQRT(uzon(j)**2+vmer(j)**2) 1062 1042 v10m(i,nsrf)=(yu10m(j) * vmer(j))/SQRT(uzon(j)**2+vmer(j)**2) 1063 1064 1043 END DO 1065 1044 1045 !IM Calcule de l'humidite relative a 2m (rh2m) pour diagnostique 1046 !IM Ajoute dependance type surface 1047 IF (thermcep) THEN 1048 DO j = 1, knon 1049 i=ni(j) 1050 zdelta1 = MAX(0.,SIGN(1., rtt-yt2m(j) )) 1051 zx_qs1 = r2es * FOEEW(yt2m(j),zdelta1)/paprs(i,1) 1052 zx_qs1 = MIN(0.5,zx_qs1) 1053 zcor1 = 1./(1.-RETV*zx_qs1) 1054 zx_qs1 = zx_qs1*zcor1 1055 1056 rh2m(i) = rh2m(i) + yq2m(j)/zx_qs1 * pctsrf(i,nsrf) 1057 qsat2m(i) = qsat2m(i) + zx_qs1 * pctsrf(i,nsrf) 1058 END DO 1059 END IF 1066 1060 1067 1061 CALL HBTM(knon, ypaprs, ypplay, & … … 1086 1080 1087 1081 #else 1088 ! not defined T2m1082 ! T2m not defined 1089 1083 ! No calculation 1090 ! Set output variables to zero 1091 DO j = 1, knon 1092 i = ni(j) 1093 pblh(i,nsrf) = 0. 1094 plcl(i,nsrf) = 0. 1095 capCL(i,nsrf) = 0. 1096 oliqCL(i,nsrf) = 0. 1097 cteiCL(i,nsrf) = 0. 1098 pblT(i,nsrf) = 0. 1099 therm(i,nsrf) = 0. 1100 trmb1(i,nsrf) = 0. 1101 trmb2(i,nsrf) = 0. 1102 trmb3(i,nsrf) = 0. 1103 END DO 1104 DO j = 1, knon 1105 i = ni(j) 1106 t2m(i,nsrf)=0. 1107 q2m(i,nsrf)=0. 1108 u10m(i,nsrf)=0. 1109 v10m(i,nsrf)=0. 1110 END DO 1084 PRINT*,' Warning !!! No T2m calculation. Output is set to zero.' 1111 1085 #endif 1112 1086 … … 1120 1094 ! 16) Calculate the mean value over all sub-surfaces for som variables 1121 1095 ! 1122 ! NB!!! jg : Pour garder la convergence numerique j'utilise pctsrf_new comme c'etait1123 ! fait dans physiq.F mais ca devrait plutot etre pctsrf???!!!!! A verifier!1124 1096 !**************************************************************************************** 1125 1097 … … 1129 1101 DO k = 1, klev 1130 1102 DO i = 1, klon 1131 zxfluxt(i,k) = zxfluxt(i,k) + flux_t(i,k,nsrf) * pctsrf _new(i,nsrf)1132 zxfluxq(i,k) = zxfluxq(i,k) + flux_q(i,k,nsrf) * pctsrf _new(i,nsrf)1133 zxfluxu(i,k) = zxfluxu(i,k) + flux_u(i,k,nsrf) * pctsrf _new(i,nsrf)1134 zxfluxv(i,k) = zxfluxv(i,k) + flux_v(i,k,nsrf) * pctsrf _new(i,nsrf)1103 zxfluxt(i,k) = zxfluxt(i,k) + flux_t(i,k,nsrf) * pctsrf(i,nsrf) 1104 zxfluxq(i,k) = zxfluxq(i,k) + flux_q(i,k,nsrf) * pctsrf(i,nsrf) 1105 zxfluxu(i,k) = zxfluxu(i,k) + flux_u(i,k,nsrf) * pctsrf(i,nsrf) 1106 zxfluxv(i,k) = zxfluxv(i,k) + flux_v(i,k,nsrf) * pctsrf(i,nsrf) 1135 1107 END DO 1136 1108 END DO … … 1143 1115 ENDDO 1144 1116 1145 1146 DO i = 1, klon1147 IF ( ABS( pctsrf_new(i, is_ter) + pctsrf_new(i, is_lic) + &1148 pctsrf_new(i, is_oce) + pctsrf_new(i, is_sic) - 1.) .GT. EPSFRA) &1149 THEN1150 WRITE(*,*) 'physiq : pb sous surface au point ', i, &1151 pctsrf_new(i, 1 : nbsrf)1152 ENDIF1153 ENDDO1154 1155 1117 ! 1156 1118 ! Incrementer la temperature du sol … … 1171 1133 1172 1134 wfbils(i,nsrf) = ( solsw(i,nsrf) + sollw(i,nsrf) & 1173 + flux_t(i,1,nsrf) + fluxlat(i,nsrf) ) * pctsrf _new(i,nsrf)1135 + flux_t(i,1,nsrf) + fluxlat(i,nsrf) ) * pctsrf(i,nsrf) 1174 1136 wfbilo(i,nsrf) = (evap(i,nsrf) - (rain_f(i) + snow_f(i))) * & 1175 pctsrf _new(i,nsrf)1176 1177 zxtsol(i) = zxtsol(i) + ts(i,nsrf) * pctsrf _new(i,nsrf)1178 zxfluxlat(i) = zxfluxlat(i) + fluxlat(i,nsrf) * pctsrf _new(i,nsrf)1137 pctsrf(i,nsrf) 1138 1139 zxtsol(i) = zxtsol(i) + ts(i,nsrf) * pctsrf(i,nsrf) 1140 zxfluxlat(i) = zxfluxlat(i) + fluxlat(i,nsrf) * pctsrf(i,nsrf) 1179 1141 1180 zt2m(i) = zt2m(i) + t2m(i,nsrf) * pctsrf _new(i,nsrf)1181 zq2m(i) = zq2m(i) + q2m(i,nsrf) * pctsrf _new(i,nsrf)1182 zu10m(i) = zu10m(i) + u10m(i,nsrf) * pctsrf _new(i,nsrf)1183 zv10m(i) = zv10m(i) + v10m(i,nsrf) * pctsrf _new(i,nsrf)1184 1185 s_pblh(i) = s_pblh(i) + pblh(i,nsrf) * pctsrf _new(i,nsrf)1186 s_plcl(i) = s_plcl(i) + plcl(i,nsrf) * pctsrf _new(i,nsrf)1187 s_capCL(i) = s_capCL(i) + capCL(i,nsrf) * pctsrf _new(i,nsrf)1188 s_oliqCL(i) = s_oliqCL(i) + oliqCL(i,nsrf)* pctsrf _new(i,nsrf)1189 s_cteiCL(i) = s_cteiCL(i) + cteiCL(i,nsrf)* pctsrf _new(i,nsrf)1190 s_pblT(i) = s_pblT(i) + pblT(i,nsrf) * pctsrf _new(i,nsrf)1191 s_therm(i) = s_therm(i) + therm(i,nsrf) * pctsrf _new(i,nsrf)1192 s_trmb1(i) = s_trmb1(i) + trmb1(i,nsrf) * pctsrf _new(i,nsrf)1193 s_trmb2(i) = s_trmb2(i) + trmb2(i,nsrf) * pctsrf _new(i,nsrf)1194 s_trmb3(i) = s_trmb3(i) + trmb3(i,nsrf) * pctsrf _new(i,nsrf)1142 zt2m(i) = zt2m(i) + t2m(i,nsrf) * pctsrf(i,nsrf) 1143 zq2m(i) = zq2m(i) + q2m(i,nsrf) * pctsrf(i,nsrf) 1144 zu10m(i) = zu10m(i) + u10m(i,nsrf) * pctsrf(i,nsrf) 1145 zv10m(i) = zv10m(i) + v10m(i,nsrf) * pctsrf(i,nsrf) 1146 1147 s_pblh(i) = s_pblh(i) + pblh(i,nsrf) * pctsrf(i,nsrf) 1148 s_plcl(i) = s_plcl(i) + plcl(i,nsrf) * pctsrf(i,nsrf) 1149 s_capCL(i) = s_capCL(i) + capCL(i,nsrf) * pctsrf(i,nsrf) 1150 s_oliqCL(i) = s_oliqCL(i) + oliqCL(i,nsrf)* pctsrf(i,nsrf) 1151 s_cteiCL(i) = s_cteiCL(i) + cteiCL(i,nsrf)* pctsrf(i,nsrf) 1152 s_pblT(i) = s_pblT(i) + pblT(i,nsrf) * pctsrf(i,nsrf) 1153 s_therm(i) = s_therm(i) + therm(i,nsrf) * pctsrf(i,nsrf) 1154 s_trmb1(i) = s_trmb1(i) + trmb1(i,nsrf) * pctsrf(i,nsrf) 1155 s_trmb2(i) = s_trmb2(i) + trmb2(i,nsrf) * pctsrf(i,nsrf) 1156 s_trmb3(i) = s_trmb3(i) + trmb3(i,nsrf) * pctsrf(i,nsrf) 1195 1157 END DO 1196 1158 END DO … … 1205 1167 PRINT*,' debut apres d_ts min max ftsol(ts)',itap,amn,amx 1206 1168 ENDIF 1207 ! 1208 ! If a sub-surface does not exsist for a grid point, the mean value for all1209 ! sub-surfaces is distributed.1210 ! 1211 DO nsrf = 1, nbsrf1212 DO i = 1, klon1213 IF ((pctsrf_new(i,nsrf) .LT. epsfra) .OR. (t2m(i,nsrf).EQ.0.)) THEN1214 ts(i,nsrf) = zxtsol(i)1215 t2m(i,nsrf) = zt2m(i)1216 q2m(i,nsrf) = zq2m(i)1217 u10m(i,nsrf) = zu10m(i)1218 v10m(i,nsrf) = zv10m(i)1219 1220 ! Les variables qui suivent sont plus utilise, donc peut-etre pas la peine a les mettre ajour1221 pblh(i,nsrf) = s_pblh(i)1222 plcl(i,nsrf) = s_plcl(i)1223 capCL(i,nsrf) = s_capCL(i)1224 oliqCL(i,nsrf) = s_oliqCL(i)1225 cteiCL(i,nsrf) = s_cteiCL(i)1226 pblT(i,nsrf) = s_pblT(i)1227 therm(i,nsrf) = s_therm(i)1228 trmb1(i,nsrf) = s_trmb1(i)1229 trmb2(i,nsrf) = s_trmb2(i)1230 trmb3(i,nsrf) = s_trmb3(i)1231 ENDIF1232 ENDDO1233 ENDDO1169 !!$! 1170 !!$! If a sub-surface does not exsist for a grid point, the mean value for all 1171 !!$! sub-surfaces is distributed. 1172 !!$! 1173 !!$ DO nsrf = 1, nbsrf 1174 !!$ DO i = 1, klon 1175 !!$ IF ((pctsrf_new(i,nsrf) .LT. epsfra) .OR. (t2m(i,nsrf).EQ.0.)) THEN 1176 !!$ ts(i,nsrf) = zxtsol(i) 1177 !!$ t2m(i,nsrf) = zt2m(i) 1178 !!$ q2m(i,nsrf) = zq2m(i) 1179 !!$ u10m(i,nsrf) = zu10m(i) 1180 !!$ v10m(i,nsrf) = zv10m(i) 1181 !!$ 1182 !!$! Les variables qui suivent sont plus utilise, donc peut-etre pas la peine a les mettre ajour 1183 !!$ pblh(i,nsrf) = s_pblh(i) 1184 !!$ plcl(i,nsrf) = s_plcl(i) 1185 !!$ capCL(i,nsrf) = s_capCL(i) 1186 !!$ oliqCL(i,nsrf) = s_oliqCL(i) 1187 !!$ cteiCL(i,nsrf) = s_cteiCL(i) 1188 !!$ pblT(i,nsrf) = s_pblT(i) 1189 !!$ therm(i,nsrf) = s_therm(i) 1190 !!$ trmb1(i,nsrf) = s_trmb1(i) 1191 !!$ trmb2(i,nsrf) = s_trmb2(i) 1192 !!$ trmb3(i,nsrf) = s_trmb3(i) 1193 !!$ ENDIF 1194 !!$ ENDDO 1195 !!$ ENDDO 1234 1196 1235 1197 … … 1242 1204 DO nsrf = 1, nbsrf 1243 1205 DO i = 1, klon 1244 zxqsurf(i) = zxqsurf(i) + qsurf(i,nsrf) * pctsrf _new(i,nsrf)1245 zxsnow(i) = zxsnow(i) + snow(i,nsrf) * pctsrf _new(i,nsrf)1206 zxqsurf(i) = zxqsurf(i) + qsurf(i,nsrf) * pctsrf(i,nsrf) 1207 zxsnow(i) = zxsnow(i) + snow(i,nsrf) * pctsrf(i,nsrf) 1246 1208 END DO 1247 1209 END DO 1248 1210 1249 !1250 !IM Calculer l'humidite relative a 2m (rh2m) pour diagnostique1251 !IM ajout dependance type surface1252 rh2m(:) = 0.01253 qsat2m(:) = 0.01254 1255 DO i = 1, klon1256 DO nsrf=1, nbsrf1257 zx_t1(i,nsrf) = t2m(i,nsrf)1258 IF (thermcep) THEN1259 zdelta1(i,nsrf) = MAX(0.,SIGN(1.,rtt-zx_t1(i,nsrf)))1260 zx_qs1(i,nsrf) = r2es * &1261 FOEEW(zx_t1(i,nsrf),zdelta1(i,nsrf))/paprs(i,1)1262 zx_qs1(i,nsrf) = MIN(0.5,zx_qs1(i,nsrf))1263 zcor1(i,nsrf) = 1./(1.-retv*zx_qs1(i,nsrf))1264 zx_qs1(i,nsrf) = zx_qs1(i,nsrf)*zcor1(i,nsrf)1265 END IF1266 zx_rh2m(i,nsrf) = q2m(i,nsrf)/zx_qs1(i,nsrf)1267 zx_qsat2m(i,nsrf)=zx_qs1(i,nsrf)1268 rh2m(i) = rh2m(i)+zx_rh2m(i,nsrf)*pctsrf_new(i,nsrf)1269 qsat2m(i)=qsat2m(i)+zx_qsat2m(i,nsrf)*pctsrf_new(i,nsrf)1270 END DO1271 END DO1272 1211 1273 1212 ! Some of the module declared variables are returned for printing in physiq.F … … 1322 1261 ! 1323 1262 !**************************************************************************************** 1263 ! 1264 SUBROUTINE pbl_surface_newfrac(itime, pctsrf_new, pctsrf_old, tsurf, alb1, alb2, u10m, v10m, tke) 1265 1266 ! Give default values where new fraction has appread 1267 1268 INCLUDE "indicesol.h" 1269 INCLUDE "dimsoil.h" 1270 INCLUDE "clesphys.h" 1271 1272 ! Input variables 1273 !**************************************************************************************** 1274 INTEGER, INTENT(IN) :: itime 1275 REAL, DIMENSION(klon,nbsrf), INTENT(IN) :: pctsrf_new, pctsrf_old 1276 1277 ! InOutput variables 1278 !**************************************************************************************** 1279 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: tsurf 1280 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: alb1, alb2 1281 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: u10m, v10m 1282 REAL, DIMENSION(klon,klev+1,nbsrf), INTENT(INOUT) :: tke 1283 1284 ! Local variables 1285 !**************************************************************************************** 1286 INTEGER :: nsrf, nsrf_comp1, nsrf_comp2, nsrf_comp3, i 1287 CHARACTER(len=80) :: abort_message 1288 CHARACTER(len=20) :: modname = 'pbl_surface_newfrac' 1289 INTEGER, DIMENSION(nbsrf) :: nfois=0, mfois=0, pfois=0 1290 LOGICAL :: debug=.FALSE. 1291 ! 1292 ! All at once !! 1293 !**************************************************************************************** 1294 1295 DO nsrf = 1, nbsrf 1296 ! First decide complement sub-surfaces 1297 SELECT CASE (nsrf) 1298 CASE(is_oce) 1299 nsrf_comp1=is_sic 1300 nsrf_comp2=is_ter 1301 nsrf_comp3=is_lic 1302 CASE(is_sic) 1303 nsrf_comp1=is_oce 1304 nsrf_comp2=is_ter 1305 nsrf_comp3=is_lic 1306 CASE(is_ter) 1307 nsrf_comp1=is_lic 1308 nsrf_comp2=is_oce 1309 nsrf_comp3=is_sic 1310 CASE(is_lic) 1311 nsrf_comp1=is_ter 1312 nsrf_comp2=is_oce 1313 nsrf_comp3=is_sic 1314 END SELECT 1315 1316 ! Initialize all new fractions 1317 DO i=1, klon 1318 IF (pctsrf_new(i,nsrf) > 0. .AND. pctsrf_old(i,nsrf) == 0.) THEN 1319 1320 IF (pctsrf_old(i,nsrf_comp1) > 0.) THEN 1321 ! Use the complement sub-surface, keeping the continents unchanged 1322 qsurf(i,nsrf) = qsurf(i,nsrf_comp1) 1323 evap(i,nsrf) = evap(i,nsrf_comp1) 1324 rugos(i,nsrf) = rugos(i,nsrf_comp1) 1325 tsurf(i,nsrf) = tsurf(i,nsrf_comp1) 1326 alb1(i,nsrf) = alb1(i,nsrf_comp1) 1327 alb2(i,nsrf) = alb2(i,nsrf_comp1) 1328 u10m(i,nsrf) = u10m(i,nsrf_comp1) 1329 v10m(i,nsrf) = v10m(i,nsrf_comp1) 1330 tke(i,:,nsrf) = tke(i,:,nsrf_comp1) 1331 mfois(nsrf) = mfois(nsrf) + 1 1332 ELSE 1333 ! The continents have changed. The new fraction receives the mean sum of the existent fractions 1334 qsurf(i,nsrf) = qsurf(i,nsrf_comp2)*pctsrf_old(i,nsrf_comp2) + qsurf(i,nsrf_comp3)*pctsrf_old(i,nsrf_comp3) 1335 evap(i,nsrf) = evap(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + evap(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) 1336 rugos(i,nsrf) = rugos(i,nsrf_comp2)*pctsrf_old(i,nsrf_comp2) + rugos(i,nsrf_comp3)*pctsrf_old(i,nsrf_comp3) 1337 tsurf(i,nsrf) = tsurf(i,nsrf_comp2)*pctsrf_old(i,nsrf_comp2) + tsurf(i,nsrf_comp3)*pctsrf_old(i,nsrf_comp3) 1338 alb1(i,nsrf) = alb1(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + alb1(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) 1339 alb2(i,nsrf) = alb2(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + alb2(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) 1340 u10m(i,nsrf) = u10m(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + u10m(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) 1341 v10m(i,nsrf) = v10m(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + v10m(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) 1342 tke(i,:,nsrf) = tke(i,:,nsrf_comp2)*pctsrf_old(i,nsrf_comp2) + tke(i,:,nsrf_comp3)*pctsrf_old(i,nsrf_comp3) 1343 1344 ! Security abort. This option has never been tested. To test, comment the following line. 1345 ! abort_message='The fraction of the continents have changed!' 1346 ! CALL abort_gcm(modname,abort_message,1) 1347 nfois(nsrf) = nfois(nsrf) + 1 1348 END IF 1349 snow(i,nsrf) = 0. 1350 agesno(i,nsrf) = 0. 1351 ftsoil(i,:,nsrf) = tsurf(i,nsrf) 1352 ELSE 1353 pfois(nsrf) = pfois(nsrf)+ 1 1354 END IF 1355 END DO 1356 1357 END DO 1358 1359 IF (debug) THEN 1360 print*,'itime=,',itime, 'Pas de nouveau fraction',pfois,'fois' 1361 print*,'itime=,',itime, 'The fraction of the continents have changed',nfois,'fois' 1362 print*,'itime=,',itime, 'The fraction ocean-seaice has changed',mfois,'fois' 1363 END IF 1364 1365 END SUBROUTINE pbl_surface_newfrac 1366 1324 1367 ! 1368 !**************************************************************************************** 1369 ! 1325 1370 1326 1371 END MODULE pbl_surface_mod -
LMDZ4/trunk/libf/phylmd/phyetat0.F
r987 r996 5 5 c 6 6 SUBROUTINE phyetat0 (fichnom, 7 . ocean_in, ok_veget_in,8 7 . clesphy0, 9 8 . tabcntr0) … … 13 12 USE mod_phys_lmdz_para 14 13 USE iophy 15 USE ocean_slab_mod, ONLY : ocean_slab_init16 14 USE ocean_cpl_mod, ONLY : ocean_cpl_init 17 USE ocean_forced_mod, ONLY : ocean_forced_init18 15 USE fonte_neige_mod, ONLY : fonte_neige_init 19 16 USE pbl_surface_mod, ONLY : pbl_surface_init 20 USE surface_data, ONLY : ocean, ok_veget17 USE surface_data, ONLY : type_ocean 21 18 USE phys_state_var_mod 22 19 … … 68 65 REAL wake_fip_glo(klon_glo) 69 66 REAL tsoil_p(klon,nsoilmx,nbsrf) 70 REAL tslab_p(klon), seaice_p(klon)71 67 REAL qsurf_p(klon,nbsrf) 72 68 REAL qsol_p(klon) … … 83 79 REAL zmasq_glo(klon_glo) 84 80 REAL tsoil(klon_glo,nsoilmx,nbsrf) 85 cIM "slab" ocean86 REAL tslab(klon_glo), seaice(klon_glo)87 81 REAL qsurf(klon_glo,nbsrf) 88 82 REAL qsol(klon_glo) … … 492 486 ENDDO 493 487 ENDDO 494 c495 cIM "slab" ocean496 c497 c Lecture de tslab (pour slab ocean seulement):498 c499 IF (ocean_in .eq. 'slab ') then500 ierr = NF_INQ_VARID (nid, "TSLAB", nvarid)501 IF (ierr.NE.NF_NOERR) THEN502 PRINT*, "phyetat0: Le champ <TSLAB> est absent"503 CALL abort504 ENDIF505 #ifdef NC_DOUBLE506 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tslab)507 #else508 ierr = NF_GET_VAR_REAL(nid, nvarid, tslab)509 #endif510 IF (ierr.NE.NF_NOERR) THEN511 PRINT*, "phyetat0: Lecture echouee pour <TSLAB>"512 CALL abort513 ENDIF514 xmin = 1.0E+20515 xmax = -1.0E+20516 DO i = 1, klon_glo517 xmin = MIN(tslab(i),xmin)518 xmax = MAX(tslab(i),xmax)519 ENDDO520 PRINT*,'Min, Max tslab (utilise si OCEAN=slab )', xmin, xmax521 c522 c Lecture de seaice (pour slab ocean seulement):523 c524 ierr = NF_INQ_VARID (nid, "SEAICE", nvarid)525 IF (ierr.NE.NF_NOERR) THEN526 PRINT*, "phyetat0: Le champ <SEAICE> est absent"527 CALL abort528 ENDIF529 #ifdef NC_DOUBLE530 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, seaice)531 #else532 ierr = NF_GET_VAR_REAL(nid, nvarid, seaice)533 #endif534 IF (ierr.NE.NF_NOERR) THEN535 PRINT*, "phyetat0: Lecture echouee pour <SEAICE>"536 CALL abort537 ENDIF538 xmin = 1.0E+20539 xmax = -1.0E+20540 DO i = 1, klon_glo541 xmin = MIN(seaice(i),xmin)542 xmax = MAX(seaice(i),xmax)543 ENDDO544 PRINT*,'Masse de la glace de mer (utilise si OCEAN=slab)',545 $ xmin, xmax546 ELSE547 tslab = 0.548 seaice = 0.549 ENDIF550 488 c 551 489 c Lecture de l'humidite de l'air juste au dessus du sol: … … 1762 1700 call Scatter( wake_fip_glo, wake_fip) 1763 1701 call Scatter( tsoil,tsoil_p) 1764 call Scatter( tslab,tslab_p)1765 call Scatter( seaice,seaice_p)1766 1702 call Scatter( qsurf,qsurf_p) 1767 1703 call Scatter( qsol,qsol_p) … … 1796 1732 1797 1733 c 1798 c Initilalize variables in module surface_data1799 c1800 ok_veget = ok_veget_in1801 ocean = ocean_in1802 c1803 1734 c Initialize module pbl_surface_mod 1804 1735 c … … 1806 1737 $ evap_p, frugs_p, agesno_p, tsoil_p) 1807 1738 1808 c Initialize ocean module according to ocean type 1809 IF ( ocean == 'slab' ) THEN 1810 c initilalize module ocean_slab_init 1811 CALL ocean_slab_init(dtime, tslab_p, seaice_p, pctsrf) 1812 ELSEIF ( ocean == 'couple' ) THEN 1813 c initilalize module ocean_cpl_init 1739 c Initialize module ocean_cpl_mod for the case of coupled ocean 1740 IF ( type_ocean == 'couple' ) THEN 1814 1741 CALL ocean_cpl_init(dtime, rlon, rlat) 1815 ELSE1816 c initilalize module ocean_forced_init1817 CALL ocean_forced_init1818 1742 ENDIF 1819 1743 c -
LMDZ4/trunk/libf/phylmd/phyredem.F
r975 r996 8 8 USE mod_grid_phy_lmdz 9 9 USE mod_phys_lmdz_para 10 USE ocean_slab_mod, ONLY : ocean_slab_final11 10 USE fonte_neige_mod, ONLY : fonte_neige_final 12 11 USE pbl_surface_mod, ONLY : pbl_surface_final 13 USE surface_data, ONLY : ocean, ok_veget14 12 USE phys_state_var_mod 15 13 … … 60 58 REAL wake_fip_glo(klon_glo) 61 59 62 cIM "slab" ocean63 60 REAL tsoil_p(klon,nsoilmx,nbsrf) 64 REAL tslab_p(klon), seaice_p(klon)65 61 REAL qsurf_p(klon,nbsrf) 66 62 REAL qsol_p(klon) … … 73 69 74 70 REAL tsoil(klon_glo,nsoilmx,nbsrf) 75 REAL tslab(klon_glo), seaice(klon_glo)76 71 REAL qsurf(klon_glo,nbsrf) 77 72 REAL qsol(klon_glo) … … 103 98 c Get a variable calculated in module fonte_neige_mod 104 99 CALL fonte_neige_final(run_off_lic_0_p) 105 106 c If slab ocean then get 2 varaibles from module ocean_slab_mod107 IF ( ocean == 'slab' ) THEN108 CALL ocean_slab_final(tslab_p, seaice_p)109 ELSE110 tslab_p(:) = 0.0111 seaice_p(:) = 0.0112 ENDIF113 100 114 101 c====================================================================== … … 150 137 151 138 call Gather( tsoil_p,tsoil) 152 call Gather( tslab_p,tslab)153 call Gather( seaice_p,seaice)154 139 call Gather( qsurf_p,qsurf) 155 140 call Gather( qsol_p,qsol) … … 390 375 ENDDO 391 376 c 392 cIM "slab" ocean393 ierr = NF_REDEF (nid)394 #ifdef NC_DOUBLE395 ierr = NF_DEF_VAR (nid, "TSLAB", NF_DOUBLE, 1, idim2,nvarid)396 #else397 ierr = NF_DEF_VAR (nid, "TSLAB", NF_FLOAT, 1, idim2,nvarid)398 #endif399 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 33,400 . "Ecart de la SST (pour slab-ocean)")401 ierr = NF_ENDDEF(nid)402 #ifdef NC_DOUBLE403 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tslab)404 #else405 ierr = NF_PUT_VAR_REAL (nid,nvarid,tslab)406 #endif407 c408 ierr = NF_REDEF (nid)409 #ifdef NC_DOUBLE410 ierr = NF_DEF_VAR (nid, "SEAICE", NF_DOUBLE, 1, idim2,nvarid)411 #else412 ierr = NF_DEF_VAR (nid, "SEAICE", NF_FLOAT, 1, idim2,nvarid)413 #endif414 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 33,415 . "Glace de mer kg/m2 (pour slab-ocean)")416 ierr = NF_ENDDEF(nid)417 #ifdef NC_DOUBLE418 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,seaice)419 #else420 ierr = NF_PUT_VAR_REAL (nid,nvarid,seaice)421 #endif422 c423 377 DO nsrf = 1, nbsrf 424 378 IF (nsrf.LE.99) THEN -
LMDZ4/trunk/libf/phylmd/phys_output_mod.F90
r976 r996 188 188 integer, dimension(nfiles) , save :: flag_philevsSTD = (/ 1, 1, 1, 10 /) 189 189 190 integer, dimension(nfiles) , save :: flag_fluxo = (/ 1, 1, 10, 10 /)191 integer, dimension(nfiles) , save :: flag_fluxg = (/ 1, 1, 10, 10 /)192 190 integer, dimension(nfiles) , save :: flag_t_oce_sic = (/ 1, 10, 10, 10 /) 193 194 integer, dimension(nfiles) , save :: flag_lmt_bils = (/ 1, 1, 10, 10 /)195 integer, dimension(nfiles) , save :: flag_tslab = (/ 1, 1, 10, 10 /)196 integer, dimension(nfiles) , save :: flag_seaice = (/ 1, 1, 10, 10 /)197 integer, dimension(nfiles) , save :: flag_siceh = (/ 1, 1, 10, 10 /)198 191 199 192 integer, dimension(nfiles) , save :: flag_weakinv = (/ 10, 1, 10, 10 /) … … 590 583 ENDDO 591 584 592 !IM diagnostiques flux ocean-atm ou ocean-glace de mer593 !IM pour utilisation dans un modele de "slab" ocean594 CALL histdef2d(iff,flag_fluxo,"fluxo","Flux turbulents ocean-atmosphere","W/m2")595 CALL histdef2d(iff,flag_fluxg,"fluxg","Flux turbulents ocean-glace de mer","W/m2")596 585 CALL histdef2d(iff,flag_t_oce_sic,"t_oce_sic","Temp mixte oce-sic","K") 597 586 598 IF (OCEAN.EQ.'force ') THEN 599 CALL histdef2d(iff,flag_lmt_bils,"lmt_bils","Bilan au sol atmosphere forcee","W/m2") 600 ELSE IF (OCEAN.EQ.'slab ') THEN 601 CALL histdef2d(iff,flag_slab_bils,"slab_bils","Bilan au sol Slab","W/m2") 602 CALL histdef2d(iff,flag_tslab,"tslab", "Slab SST ", "K") 603 CALL histdef2d(iff,flag_seaice,"seaice","Slab seaice","kg/m2") 604 CALL histdef2d(iff,flag_siceh,"siceh","Slab seaice height","m") 605 ENDIF 587 IF (ocean=='slab') & 588 CALL histdef2d(iff,flag_slab_bils, "slab_wbils_oce","Bilan au sol sur ocean slab", "W/m2") 606 589 607 590 CALL histdef2d(iff,flag_ale_bl,"ale_bl","ALE BL","m2/s2") -
LMDZ4/trunk/libf/phylmd/phys_output_write.h
r973 r996 41 41 IF (flag_contfracOR(iff)<=lev_files(iff)) THEN 42 42 CALL histwrite_phy(nid_files(iff),"contfracOR",itau_w, 43 $ pctsrf _new(:,is_ter))43 $ pctsrf(:,is_ter)) 44 44 ENDIF 45 45 … … 599 599 ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR. 600 600 ENDDO 601 602 !IM diagnostiques flux ocean-atm ou ocean-glace de mer603 !IM pour utilisation dans un modele de "slab" ocean604 605 IF (flag_fluxo(iff)<=lev_files(iff)) THEN606 DO i=1, klon607 IF (pctsrf(i,is_oce).GT.epsfra) THEN608 zx_tmp_fi2d(i) = fluxo(i)609 ELSE610 zx_tmp_fi2d(i) = 0.611 ENDIF612 ENDDO613 CALL histwrite_phy(nid_files(iff),"fluxo",itau_w,zx_tmp_fi2d)614 ENDIF615 616 IF (flag_fluxg(iff)<=lev_files(iff)) THEN617 DO i=1, klon618 IF (pctsrf(i,is_sic).GT.epsfra) THEN619 zx_tmp_fi2d(i) = fluxg(i)620 ELSE621 zx_tmp_fi2d(i) = 0.622 ENDIF623 ENDDO624 CALL histwrite_phy(nid_files(iff),"fluxg",itau_w,zx_tmp_fi2d)625 ENDIF626 601 627 602 IF (flag_t_oce_sic(iff)<=lev_files(iff)) THEN … … 639 614 ENDIF 640 615 641 IF (OCEAN.EQ.'force ') THEN 642 IF (flag_lmt_bils(iff)<=lev_files(iff)) THEN 643 DO i=1, klon 644 IF((pctsrf(i,is_oce).GT.epsfra).OR. 645 $ (pctsrf(i,is_sic).GT.epsfra)) THEN 646 zx_tmp_fi2d(i) = (radsol(i) + fluxo(i))*pctsrf(i,is_oce)+ 647 $ fluxg(i)*pctsrf(i,is_sic) 648 ELSE 649 zx_tmp_fi2d(i) = 1.E+20 650 ENDIF 651 ENDDO 652 CALL histwrite_phy(nid_files(iff),"lmt_bils",itau_w,zx_tmp_fi2d) 653 ENDIF 616 IF (type_ocean=='force ') THEN 654 617 655 618 IF (iflag_coupl.EQ.1) THEN … … 683 646 ENDIF 684 647 ENDIF 685 686 ELSE IF (OCEAN.EQ.'slab ') THEN 687 688 IF (flag_slab_bils(iff)<=lev_files(iff)) THEN 689 DO i=1, klon 690 IF((pctsrf(i,is_oce).GT.epsfra).OR. 691 $ (pctsrf(i,is_sic).GT.epsfra)) THEN 692 zx_tmp_fi2d(i) = (radsol(i) + fluxo(i))*pctsrf(i,is_oce)+ 693 $ fluxg(i)*pctsrf(i,is_sic) 694 ELSE 695 zx_tmp_fi2d(i) = 1.E+20 696 ENDIF 697 ENDDO 698 CALL histwrite_phy(nid_files(iff),"slab_bils",itau_w,zx_tmp_fi2d) 699 ENDIF 700 701 IF (flag_tslab(iff)<=lev_files(iff)) THEN 702 DO i=1, klon 703 IF(pctsrf(i,is_oce).GT.epsfra.OR. 704 $ pctsrf(i,is_sic).GT.epsfra) THEN 705 zx_tmp_fi2d(i)=tslab(i) 706 ELSE 707 zx_tmp_fi2d(i) = 1.E+20 708 ENDIF 709 ENDDO !i=1, klon 710 CALL histwrite_phy(nid_files(iff),"tslab",itau_w,zx_tmp_fi2d) 711 ENDIF 712 713 IF (flag_seaice(iff)<=lev_files(iff)) THEN 714 CALL histwrite_phy(nid_files(iff),"seaice",itau_w,seaice) 715 ENDIF 716 717 IF (flag_siceh(iff)<=lev_files(iff)) THEN 718 CALL histwrite_phy(nid_files(iff),"siceh",itau_w, seaice/1000.) 719 ENDIF 720 ENDIF !OCEAN.EQ.force/slab 648 649 ELSE IF (type_ocean=='slab ') THEN 650 651 IF ( flag_slab_bils(iff)<=lev_files(iff)) 652 $ CALL histwrite_phy( 653 $ nid_files(iff),"slab_wbils_oce",itau_w,slab_wfbils) 654 655 ENDIF !type_ocean == force/slab 721 656 722 657 IF (flag_weakinv(iff)<=lev_files(iff)) THEN -
LMDZ4/trunk/libf/phylmd/physiq.F
r987 r996 24 24 USE vampir 25 25 USE pbl_surface_mod, ONLY : pbl_surface 26 USE surface_data, ONLY : ocean, ok_veget 26 USE change_srf_frac_mod 27 USE surface_data, ONLY : type_ocean, ok_veget 27 28 USE phys_local_var_mod ! Variables internes non sauvegardees de la physique 28 29 USE phys_state_var_mod ! Variables sauvegardees de la physique 29 30 31 USE ocean_slab_mod, ONLY : ocean_slab_get_vars32 USE ocean_cpl_mod, ONLY : ocean_cpl_get_vars33 USE ocean_forced_mod, ONLY : ocean_forced_get_vars34 30 USE fonte_neige_mod, ONLY : fonte_neige_get_vars 35 31 USE phys_output_mod … … 120 116 LOGICAL, SAVE :: rnpb=.TRUE. 121 117 c$OMP THREADPRIVATE(rnpb) 122 cIM "slab" ocean123 REAL tslab(klon) !Temperature du slab-ocean124 REAL seaice(klon) !glace de mer (kg/m2)125 REAL fluxo(klon) !flux turbulents ocean-glace de mer126 REAL fluxg(klon) !flux turbulents ocean-atmosphere127 118 REAL amn, amx 128 119 INTEGER igout … … 699 690 REAL wfbils(klon,nbsrf) ! bilan de chaleur au sol, pour chaque 700 691 C ! type de sous-surface et pondere par la fraction 692 REAL slab_wfbils(klon) ! bilan de chaleur au sol pour le cas de slab, sur les points d'ocean 693 701 694 REAL fder(klon) 702 695 REAL ve(klon) ! integr. verticale du transport meri. de l'energie … … 715 708 SAVE lmt_pas ! frequence de mise a jour 716 709 c$OMP THREADPRIVATE(lmt_pas) 717 cIM718 REAL pctsrf_new(klon,nbsrf) !pourcentage surfaces issus d'ORCHIDEE719 720 cym SAVE pctsrf ! sous-fraction du sol721 710 722 711 cIM sorties … … 1239 1228 c appel a la lecture du run.def physique 1240 1229 c 1241 call conf_phys(o cean, ok_veget, ok_journe, ok_mensuel,1230 call conf_phys(ok_journe, ok_mensuel, 1242 1231 . ok_instan, ok_hf, 1243 1232 . solarlong0,seuil_inversion, … … 1279 1268 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1280 1269 1281 CALL phyetat0 ("startphy.nc", ocean, ok_veget,clesphy0,tabcntr0)1270 CALL phyetat0 ("startphy.nc",clesphy0,tabcntr0) 1282 1271 cIM begin 1283 1272 print*,'physiq: clwcon rnebcon ratqs',clwcon(1,1),rnebcon(1,1) … … 1288 1277 1289 1278 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1290 1291 1292 DO i=1,klon1293 IF ( abs( pctsrf(i, is_ter) + pctsrf(i, is_lic) +1294 $ pctsrf(i, is_oce) + pctsrf(i, is_sic) - 1.) .GT. EPSFRA)1295 $ THEN1296 WRITE(*,*)1297 $ 'physiq apres lecture de restart: pb sous surface au point ',1298 $ i, pctsrf(i, 1 : nbsrf)1299 ENDIF1300 ENDDO1301 1302 1279 c 1303 1280 C on remet le calendrier a zero … … 1518 1495 call phys_output_open(jjmp1,nqmax,nlevSTD,clevSTD,nbteta, 1519 1496 & ctetaSTD,dtime,presnivs,ok_veget, 1520 & ocean,iflag_pbl,ok_mensuel,ok_journe,1497 & type_ocean,iflag_pbl,ok_mensuel,ok_journe, 1521 1498 & ok_hf,ok_instan,nid_files) 1522 1499 c$OMP END MASTER … … 1581 1558 c 1582 1559 ENDIF 1583 c 1584 c **************** Fin de IF ( debut ) *************** 1585 c 1560 ! 1561 ! **************** Fin de IF ( debut ) *************** 1562 ! 1563 ! 1564 ! Incrementer le compteur de la physique 1565 ! 1566 itap = itap + 1 1567 julien = MOD(NINT(xjour),360) 1568 if (julien .eq. 0) julien = 360 1569 1570 ! 1571 ! Update fraction of the sub-surfaces (pctsrf) and 1572 ! initialize, where a new fraction has appeared, all variables depending 1573 ! on the surface fraction. 1574 ! 1575 CALL change_srf_frac(itap, dtime, julien, 1576 * pctsrf, falb1, falb2, ftsol, u10m, v10m, pbl_tke) 1577 1586 1578 1587 1579 ! Tendances bidons pour les processus qui n'affectent pas certaines … … 1725 1717 cIM END 1726 1718 c 1727 c Incrementer le compteur de la physique1728 c1729 itap = itap + 11730 julien = MOD(NINT(xjour),360)1731 if (julien .eq. 0) julien = 3601732 c1733 1719 c Mettre en action les conditions aux limites (albedo, sst, etc.). 1734 1720 c Prescrire l'ozone et calculer l'albedo sur l'ocean. … … 1836 1822 s zxtsol, zxfluxlat, zt2m, qsat2m, 1837 1823 s d_t_vdf, d_q_vdf, d_u_vdf, d_v_vdf, 1838 s ycoefh, pctsrf_new,1824 s ycoefh, slab_wfbils, 1839 1825 d qsol, zq2m, s_pblh, s_lcl, 1840 1826 d s_capCL, s_oliqCL, s_cteiCL,s_pblT, … … 1847 1833 - dsens, devap, zxsnow, 1848 1834 - zxfluxt, zxfluxq, q2m, fluxq, pbl_tke ) 1849 c 1850 c 1851 pctsrf(:,:) = pctsrf_new(:,:) 1835 1852 1836 1853 1837 !----------------------------------------------------------------------------------------- … … 3332 3316 . zxfqcalving, zxfqfonte, zxffonte) 3333 3317 3334 IF (ocean == 'slab') THEN3335 ! Get some variables from module ocean_slab_mod3336 CALL ocean_slab_get_vars(tslab, seaice, fluxo, fluxg)3337 ELSEIF (ocean == 'couple') THEN3338 ! Get some variables from module ocean_cpl_mod3339 CALL ocean_cpl_get_vars(fluxo, fluxg)3340 ELSE3341 ! Get some variables from module ocean_forced_mod3342 CALL ocean_forced_get_vars(fluxo, fluxg)3343 ENDIF3344 3345 3318 3346 3319 c Commente par abderrahmane le 11 2 08 -
LMDZ4/trunk/libf/phylmd/surf_land_bucket_mod.F90
r888 r996 8 8 ! This module is used when no external land model is choosen. 9 9 ! 10 USE fonte_neige_mod11 USE calcul_fluxs_mod12 USE dimphy13 USE mod_grid_phy_lmdz14 USE mod_phys_lmdz_para15 16 10 IMPLICIT NONE 17 11 … … 26 20 fluxsens, fluxlat, tsurf_new, dflux_s, dflux_l) 27 21 22 USE limit_read_mod 23 USE surface_data 24 USE fonte_neige_mod 25 USE calcul_fluxs_mod 26 USE cpl_mod 27 USE dimphy 28 USE mod_grid_phy_lmdz 29 USE mod_phys_lmdz_para 28 30 !**************************************************************************************** 29 31 ! Bucket calculations for surface. … … 74 76 REAL, DIMENSION(klon) :: zfra 75 77 REAL, DIMENSION(klon) :: radsol ! total net radiance at surface 78 REAL, DIMENSION(klon) :: dummy_riverflow,dummy_coastalflow 76 79 INTEGER :: i 77 80 ! … … 82 85 !* Read from limit.nc : albedo(alb_lim), length of rugosity(z0_new) 83 86 ! 84 CALL interfsur_lim(itime, dtime, jour, & 85 knon, knindex, debut, & 86 alb_lim, z0_new) 87 87 CALL limit_read_rug_alb(itime, dtime, jour,& 88 knon, knindex, & 89 z0_new, alb_lim) 88 90 ! 89 91 !* Calcultaion of fluxes … … 145 147 !* Calculate the rugosity 146 148 ! 147 z0_new = SQRT(z0_new**2+rugoro**2) 148 149 DO i = 1, knon 150 z0_new(i) = SQRT(z0_new(i)**2+rugoro(i)**2) 151 END DO 152 153 !* Send to coupler 154 ! The run-off from river and coast are not calculated in the bucket modele. 155 ! For testing purpose of the coupled modele we put the run-off to zero. 156 IF (type_ocean=='couple') THEN 157 dummy_riverflow(:) = 0.0 158 dummy_coastalflow(:) = 0.0 159 CALL cpl_send_land_fields(itime, knon, knindex, & 160 dummy_riverflow, dummy_coastalflow) 161 ENDIF 162 149 163 ! 150 164 !* End … … 154 168 !**************************************************************************************** 155 169 ! 156 SUBROUTINE interfsur_lim(itime, dtime, jour, &157 knon, knindex, debut, &158 lmt_alb_p, lmt_rug_p)159 160 ! Cette routine sert d'interface entre le modele atmospherique et un fichier161 ! de conditions aux limites162 !163 ! L. Fairhead 02/2000164 !165 ! input:166 ! itime numero du pas de temps courant167 ! dtime pas de temps de la physique (en s)168 ! jour jour a lire dans l'annee169 ! knon nombre de points dans le domaine a traiter170 ! knindex index des points de la surface a traiter171 ! debut logical: 1er appel a la physique (initialisation)172 !173 ! output:174 ! lmt_alb_p Albedo lu175 ! lmt_rug_p longueur de rugosite lue176 177 INCLUDE "netcdf.inc"178 179 ! Input variables180 !****************************************************************************************181 INTEGER, INTENT(IN) :: itime182 REAL , INTENT(IN) :: dtime183 INTEGER, INTENT(IN) :: jour184 INTEGER, INTENT(IN) :: knon185 INTEGER, DIMENSION(klon_loc), INTENT(IN) :: knindex186 LOGICAL, INTENT(IN) :: debut187 188 ! Output variables189 !****************************************************************************************190 REAL, INTENT(out), DIMENSION(klon_loc) :: lmt_alb_p191 REAL, INTENT(out), DIMENSION(klon_loc) :: lmt_rug_p192 193 ! Local variables with attribute SAVE194 !****************************************************************************************195 INTEGER,SAVE :: lmt_pas ! frequence de lecture des conditions limites196 ! (en pas de physique)197 !$OMP THREADPRIVATE(lmt_pas)198 LOGICAL,SAVE :: deja_lu_sur ! pour indiquer que le jour a lire a deja199 ! lu pour une surface precedente200 !$OMP THREADPRIVATE(deja_lu_sur)201 INTEGER,SAVE :: jour_lu_sur202 !$OMP THREADPRIVATE(jour_lu_sur)203 CHARACTER (len = 20),SAVE :: fich ='limit.nc'204 !$OMP THREADPRIVATE(fich)205 LOGICAL,SAVE :: check = .FALSE.206 !$OMP THREADPRIVATE(check)207 ! Champs lus dans le fichier de CL208 REAL, ALLOCATABLE , SAVE, DIMENSION(:) :: alb_lu_p, rug_lu_p209 !$OMP THREADPRIVATE(alb_lu_p, rug_lu_p)210 211 ! quelques variables pour netcdf212 INTEGER ,SAVE :: nid, nvarid213 !$OMP THREADPRIVATE(nid, nvarid)214 INTEGER, DIMENSION(2),SAVE :: start, epais215 !$OMP THREADPRIVATE(start, epais)216 217 ! Other local variables218 !****************************************************************************************219 INTEGER :: ii, ierr220 CHARACTER (len = 20) :: modname = 'interfsur_lim'221 CHARACTER (len = 80) :: abort_message222 REAL, DIMENSION(klon_glo) :: alb_lu223 REAL, DIMENSION(klon_glo) :: rug_lu224 225 !226 ! End delaration227 !****************************************************************************************228 229 IF (debut) THEN230 lmt_pas = NINT(86400./dtime * 1.0) ! pour une lecture une fois par jour231 jour_lu_sur = jour - 1232 ALLOCATE(alb_lu_p(klon_loc))233 ALLOCATE(rug_lu_p(klon_loc))234 ENDIF235 236 IF ((jour - jour_lu_sur) /= 0) deja_lu_sur = .FALSE.237 238 IF (check) WRITE(*,*) modname,':: jour_lu_sur, deja_lu_sur', jour_lu_sur, deja_lu_sur239 IF (check) WRITE(*,*) modname,':: itime, lmt_pas', itime, lmt_pas240 IF (check) CALL flush(6)241 242 !243 ! Tester d'abord si c'est le moment de lire le fichier244 !245 IF (MOD(itime-1, lmt_pas) == 0 .AND. .NOT. deja_lu_sur) THEN246 247 !248 ! Ouverture et lecture du fichier249 !250 !$OMP MASTER251 IF (is_mpi_root) THEN252 fich = TRIM(fich)253 IF (check) WRITE(*,*)modname,' ouverture fichier ',fich254 IF (check) CALL flush(6)255 ierr = NF_OPEN (fich, NF_NOWRITE,nid)256 IF (ierr.NE.NF_NOERR) THEN257 abort_message = 'Pb d''ouverture du fichier de conditions aux limites'258 CALL abort_gcm(modname,abort_message,1)259 ENDIF260 !261 ! La tranche de donnees a lire:262 start(1) = 1263 start(2) = jour264 epais(1) = klon_glo265 epais(2) = 1266 !267 ! Lecture albedo268 ierr = NF_INQ_VARID(nid, 'ALB', nvarid)269 IF (ierr /= NF_NOERR) THEN270 abort_message = 'Le champ <ALB> est absent'271 CALL abort_gcm(modname,abort_message,1)272 ENDIF273 #ifdef NC_DOUBLE274 ierr = NF_GET_VARA_DOUBLE(nid,nvarid,start,epais, alb_lu)275 #else276 ierr = NF_GET_VARA_REAL(nid,nvarid,start,epais, alb_lu)277 #endif278 IF (ierr /= NF_NOERR) THEN279 abort_message = 'Lecture echouee pour <ALB>'280 CALL abort_gcm(modname,abort_message,1)281 ENDIF282 !283 ! Lecture rugosite!284 ierr = NF_INQ_VARID(nid, 'RUG', nvarid)285 IF (ierr /= NF_NOERR) THEN286 abort_message = 'Le champ <RUG> est absent'287 CALL abort_gcm(modname,abort_message,1)288 ENDIF289 #ifdef NC_DOUBLE290 ierr = NF_GET_VARA_DOUBLE(nid,nvarid,start,epais, rug_lu)291 #else292 ierr = NF_GET_VARA_REAL(nid,nvarid,start,epais, rug_lu)293 #endif294 IF (ierr /= NF_NOERR) THEN295 abort_message = 'Lecture echouee pour <RUG>'296 CALL abort_gcm(modname,abort_message,1)297 ENDIF298 299 !300 ! Fin de lecture301 ierr = NF_CLOSE(nid)302 303 ENDIF ! is_mpi_root304 !$OMP END MASTER305 306 CALL Scatter(alb_lu,alb_lu_p)307 CALL Scatter(rug_lu,rug_lu_p)308 309 deja_lu_sur = .TRUE.310 jour_lu_sur = jour311 312 ENDIF313 314 !315 ! Recopie des variables dans les champs de sortie316 !317 lmt_alb_p(:) = 999999.318 lmt_rug_p(:) = 999999.319 DO ii = 1, knon320 lmt_alb_p(ii) = alb_lu_p(knindex(ii))321 lmt_rug_p(ii) = rug_lu_p(knindex(ii))322 ENDDO323 324 325 END SUBROUTINE interfsur_lim326 !327 !****************************************************************************************328 !329 170 END MODULE surf_land_bucket_mod -
LMDZ4/trunk/libf/phylmd/surf_land_mod.F90
r888 r996 26 26 snow, qsol, agesno, tsoil, & 27 27 z0_new, alb1_new, alb2_new, evap, fluxsens, fluxlat, & 28 qsurf, tsurf_new, dflux_s, dflux_l, pctsrf_ter,&28 qsurf, tsurf_new, dflux_s, dflux_l, & 29 29 lwdown_m) 30 30 … … 75 75 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new 76 76 REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l 77 REAL, DIMENSION(klon), INTENT(OUT) :: pctsrf_ter78 77 79 78 ! Local variables … … 154 153 ENDIF ! ok_veget 155 154 156 !****************************************************************************************157 ! Return the pourcentage of land in each grid cell, even if not changed in here!158 !159 !****************************************************************************************160 pctsrf_ter(:) = pctsrf(:,is_ter)161 162 163 155 END SUBROUTINE surf_land 164 156 ! -
LMDZ4/trunk/libf/phylmd/surf_land_orchidee_mod.F90
r987 r996 15 15 USE intersurf ! module d'ORCHIDEE 16 16 USE cpl_mod, ONLY : cpl_send_land_fields 17 USE surface_data, ONLY : ocean, ok_veget17 USE surface_data, ONLY : type_ocean 18 18 USE comgeomphy, ONLY : cuphy, cvphy 19 19 USE mod_grid_phy_lmdz … … 199 199 200 200 IF (check) WRITE(lunout,*)'Entree ', modname 201 IF (check) WRITE(lunout,*)'ok_veget = ',ok_veget202 201 203 202 ! Initialisation … … 416 415 !* Send to coupler 417 416 ! 418 IF ( ocean=='couple') THEN417 IF (type_ocean=='couple') THEN 419 418 CALL cpl_send_land_fields(itime, knon, knindex, & 420 419 riverflow, coastalflow) -
LMDZ4/trunk/libf/phylmd/surf_landice_mod.F90
r888 r996 5 5 6 6 USE dimphy 7 USE surface_data, ONLY : ocean, calice, calsno7 USE surface_data, ONLY : type_ocean, calice, calsno 8 8 USE fonte_neige_mod, ONLY : fonte_neige, run_off_lic 9 9 USE cpl_mod, ONLY : cpl_send_landice_fields … … 23 23 snow, qsurf, qsol, agesno, & 24 24 tsoil, z0_new, alb1, alb2, evap, fluxsens, fluxlat, & 25 tsurf_new, dflux_s, dflux_l , pctsrf_lic)25 tsurf_new, dflux_s, dflux_l) 26 26 27 27 INCLUDE "indicesol.h" … … 64 64 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new 65 65 REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l 66 REAL, DIMENSION(klon), INTENT(OUT) :: pctsrf_lic67 66 68 67 ! Local variables … … 153 152 z0_new(:) = rugoro(:) 154 153 155 156 !****************************************************************************************157 ! Return the pourcentage for this sub-surface158 !159 !****************************************************************************************160 pctsrf_lic(:) = pctsrf(:,is_lic)161 162 163 154 !**************************************************************************************** 164 155 ! Send run-off on land-ice to coupler if coupled ocean. … … 166 157 ! 167 158 !**************************************************************************************** 168 IF ( ocean=='couple') THEN159 IF (type_ocean=='couple') THEN 169 160 CALL cpl_send_landice_fields(itime, knon, knindex, run_off_lic) 170 161 ENDIF -
LMDZ4/trunk/libf/phylmd/surf_ocean_mod.F90
r888 r996 5 5 6 6 USE dimphy 7 USE surface_data, ONLY : ocean7 USE surface_data, ONLY : type_ocean 8 8 USE ocean_forced_mod, ONLY : ocean_forced_noice 9 9 USE ocean_slab_mod, ONLY : ocean_slab_noice … … 17 17 ! 18 18 SUBROUTINE surf_ocean(rlon, rlat, swnet, lwnet, alb1, & 19 rugos, windsp, rmu0, fder, &19 rugos, windsp, rmu0, fder, tsurf_in, & 20 20 itime, dtime, jour, knon, knindex, & 21 21 debut, & … … 25 25 snow, qsurf, agesno, & 26 26 z0_new, alb1_new, alb2_new, evap, fluxsens, fluxlat, & 27 tsurf_new, dflux_s, dflux_l, pctsrf_oce)27 tsurf_new, dflux_s, dflux_l, lmt_bils) 28 28 ! 29 29 ! This subroutine will make a call to ocean_XXX_noice according to the ocean mode (force, … … 47 47 REAL, DIMENSION(klon), INTENT(IN) :: rmu0 48 48 REAL, DIMENSION(klon), INTENT(IN) :: fder 49 REAL, DIMENSION(klon), INTENT(IN) :: tsurf_in 49 50 REAL, DIMENSION(klon), INTENT(IN) :: p1lay 50 51 REAL, DIMENSION(klon), INTENT(IN) :: tq_cdrag … … 74 75 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new 75 76 REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l 76 REAL, DIMENSION(klon), INTENT(OUT) :: pctsrf_oce 77 77 REAL, DIMENSION(klon), INTENT(OUT) :: lmt_bils 78 78 79 79 ! Local variables … … 97 97 ! Switch according to type of ocean (couple, slab or forced) 98 98 !**************************************************************************************** 99 SELECT CASE( ocean)99 SELECT CASE(type_ocean) 100 100 CASE('couple') 101 101 CALL ocean_cpl_noice( & … … 106 106 p1lay, tq_cdrag, precip_rain, precip_snow,temp_air,spechum,& 107 107 petAcoef, peqAcoef, petBcoef, peqBcoef, & 108 ps, u1_lay, v1_lay, pctsrf,&108 ps, u1_lay, v1_lay, & 109 109 radsol, snow, agesno, & 110 110 qsurf, evap, fluxsens, fluxlat, & 111 tsurf_new, dflux_s, dflux_l , pctsrf_oce)111 tsurf_new, dflux_s, dflux_l) 112 112 113 113 CASE('slab') 114 114 CALL ocean_slab_noice( & 115 dtime, knon, knindex, &115 itime, dtime, jour, knon, knindex, & 116 116 p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum,& 117 117 petAcoef, peqAcoef, petBcoef, peqBcoef, & 118 ps, u1_lay, v1_lay, &118 ps, u1_lay, v1_lay, tsurf_in, & 119 119 radsol, snow, agesno, & 120 120 qsurf, evap, fluxsens, fluxlat, & 121 tsurf_new, dflux_s, dflux_l, pctsrf_oce)121 tsurf_new, dflux_s, dflux_l, lmt_bils) 122 122 123 123 CASE('force') … … 131 131 radsol, snow, agesno, & 132 132 qsurf, evap, fluxsens, fluxlat, & 133 tsurf_new, dflux_s, dflux_l , pctsrf_oce)133 tsurf_new, dflux_s, dflux_l) 134 134 END SELECT 135 135 -
LMDZ4/trunk/libf/phylmd/surf_seaice_mod.F90
r888 r996 5 5 6 6 USE dimphy 7 USE surface_data, ONLY : ocean 8 USE ocean_slab_mod, ONLY : ocean_slab_ice 7 USE surface_data 9 8 USE ocean_forced_mod, ONLY : ocean_forced_ice 10 9 USE ocean_cpl_mod, ONLY : ocean_cpl_ice … … 24 23 snow, qsurf, qsol, agesno, tsoil, & 25 24 z0_new, alb1_new, alb2_new, evap, fluxsens, fluxlat, & 26 tsurf_new, dflux_s, dflux_l , pctsrf_sic)25 tsurf_new, dflux_s, dflux_l) 27 26 ! 28 27 ! This subroutine will make a call to ocean_XXX_ice according to the ocean mode (force, … … 70 69 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new 71 70 REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l 72 REAL, DIMENSION(klon), INTENT(OUT) :: pctsrf_sic73 71 74 72 ! Local arguments … … 91 89 ! 92 90 !**************************************************************************************** 93 SELECT CASE(ocean)94 CASE('couple')91 IF (type_ocean == 'couple') THEN 92 95 93 CALL ocean_cpl_ice( & 96 rlon, rlat, swnet, lwnet, alb1, & 97 fder, & 98 itime, dtime, knon, knindex, & 99 lafin,& 100 p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum,& 101 petAcoef, peqAcoef, petBcoef, peqBcoef, & 102 ps, u1_lay, v1_lay, pctsrf, & 103 radsol, snow, qsurf, & 104 alb1_new, alb2_new, evap, fluxsens, fluxlat, & 105 tsurf_new, dflux_s, dflux_l, pctsrf_sic) 94 rlon, rlat, swnet, lwnet, alb1, & 95 fder, & 96 itime, dtime, knon, knindex, & 97 lafin,& 98 p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum,& 99 petAcoef, peqAcoef, petBcoef, peqBcoef, & 100 ps, u1_lay, v1_lay, pctsrf, & 101 radsol, snow, qsurf, & 102 alb1_new, alb2_new, evap, fluxsens, fluxlat, & 103 tsurf_new, dflux_s, dflux_l) 104 105 ELSE IF (type_ocean == 'force' .OR. (type_ocean == 'slab' .AND. version_ocean=='sicOBS')) THEN 106 CALL ocean_forced_ice(itime, dtime, jour, knon, knindex, & 107 debut, & 108 tsurf, p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum,& 109 petAcoef, peqAcoef, petBcoef, peqBcoef, & 110 ps, u1_lay, v1_lay, & 111 radsol, snow, qsol, agesno, tsoil, & 112 qsurf, alb1_new, alb2_new, evap, fluxsens, fluxlat, & 113 tsurf_new, dflux_s, dflux_l) 106 114 107 CASE('slab') 108 CALL ocean_slab_ice( & 109 itime, dtime, jour, knon, knindex, & 110 debut, & 111 tsurf, p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum,& 112 petAcoef, peqAcoef, petBcoef, peqBcoef, & 113 ps, u1_lay, v1_lay, & 114 radsol, snow, qsurf, qsol, agesno, tsoil, & 115 alb1_new, alb2_new, evap, fluxsens, fluxlat, & 116 tsurf_new, dflux_s, dflux_l, pctsrf_sic) 117 118 CASE('force') 119 CALL ocean_forced_ice(itime, dtime, jour, knon, knindex, & 120 debut, & 121 tsurf, p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum,& 122 petAcoef, peqAcoef, petBcoef, peqBcoef, & 123 ps, u1_lay, v1_lay, & 124 radsol, snow, qsol, agesno, tsoil, & 125 qsurf, alb1_new, alb2_new, evap, fluxsens, fluxlat, & 126 tsurf_new, dflux_s, dflux_l, pctsrf_sic) 127 END SELECT 115 ELSE IF (type_ocean == 'slab') THEN 116 !!$ CALL ocean_slab_ice( & 117 !!$ itime, dtime, jour, knon, knindex, & 118 !!$ debut, & 119 !!$ tsurf, p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum,& 120 !!$ petAcoef, peqAcoef, petBcoef, peqBcoef, & 121 !!$ ps, u1_lay, v1_lay, pctsrf, & 122 !!$ radsol, snow, qsurf, qsol, agesno, tsoil, & 123 !!$ alb1_new, alb2_new, evap, fluxsens, fluxlat, & 124 !!$ tsurf_new, dflux_s, dflux_l) 125 126 END IF 128 127 129 128 !**************************************************************************************** -
LMDZ4/trunk/libf/phylmd/surface_data.F90
r803 r996 4 4 MODULE surface_data 5 5 6 USE dimphy, ONLY : klon7 8 6 REAL, PARAMETER :: calice=1.0/(5.1444e+06*0.15) 9 7 REAL, PARAMETER :: tau_gl=86400.*5. 10 8 REAL, PARAMETER :: calsno=1./(2.3867e+06*.15) 11 9 12 LOGICAL, SAVE :: ok_veget 10 LOGICAL, SAVE :: ok_veget ! true for use of vegetation model ORCHIDEE 13 11 !$OMP THREADPRIVATE(ok_veget) 14 CHARACTER(len=6), SAVE :: ocean ! force/slab/couple 15 !$OMP THREADPRIVATE(ocean) 12 13 CHARACTER(len=6), SAVE :: type_ocean ! force/slab/couple 14 !$OMP THREADPRIVATE(type_ocean) 15 16 ! if type_ocean=couple : version_ocean=opa8 ou nemo 17 ! if type_ocean=slab : version_ocean=sicOBS 18 CHARACTER(len=6), SAVE :: version_ocean 19 !$OMP THREADPRIVATE(version_ocean) 16 20 17 21 END MODULE surface_data -
LMDZ4/trunk/libf/phylmd/write_histday.h
r895 r996 32 32 CALL histwrite_phy(nid_day,"contfracATM",itau_w,zx_tmp_fi2d) 33 33 c 34 cym CALL gr_fi_ecrit(1,klon,iim,jjmp1,pctsrf _new(:,is_ter),zx_tmp_2d)34 cym CALL gr_fi_ecrit(1,klon,iim,jjmp1,pctsrf(:,is_ter),zx_tmp_2d) 35 35 CALL histwrite_phy(nid_day,"contfracOR",itau_w, 36 & pctsrf _new(:,is_ter))36 & pctsrf(:,is_ter)) 37 37 c 38 38 -
LMDZ4/trunk/libf/phylmd/write_histday_seri.h
r778 r996 191 191 c 192 192 c ok_msk=.TRUE. 193 c msk(1:klon)=pctsrf _new(1:klon,is_ter)193 c msk(1:klon)=pctsrf(1:klon,is_ter) 194 194 c CALL moyglo_pondaire(klon, zx_tmp_fi2d, airephy, 195 195 c . ok_msk, msk, moyglo) -
LMDZ4/trunk/libf/phylmd/write_histhf.h
r888 r996 24 24 CALL histwrite_phy(nid_hf,"contfracATM",itau_w,zx_tmp_fi2d) 25 25 c 26 cym CALL gr_fi_ecrit(1,klon,iim,jjmp1,pctsrf _new(:,is_ter),zx_tmp_2d)26 cym CALL gr_fi_ecrit(1,klon,iim,jjmp1,pctsrf(:,is_ter),zx_tmp_2d) 27 27 CALL histwrite_phy(nid_hf,"contfracOR",itau_w, 28 . pctsrf _new(:,is_ter))28 . pctsrf(:,is_ter)) 29 29 c 30 30 cym CALL gr_fi_ecrit(1, klon,iim,jjmp1, zt2m,zx_tmp_2d) -
LMDZ4/trunk/libf/phylmd/write_paramLMDZ_phy.h
r956 r996 7 7 c Variables type caractere : plusieurs valeurs possibles 8 8 c 9 IF( ocean.EQ.'force ') THEN10 zx_tmp_2d(1:iim,1:jjmp1)=1. 11 ELSE IF( ocean.EQ.'slab ') THEN9 IF(type_ocean.EQ.'force ') THEN 10 zx_tmp_2d(1:iim,1:jjmp1)=1. 11 ELSE IF(type_ocean.EQ.'slab ') THEN 12 12 zx_tmp_2d(1:iim,1:jjmp1)=2. 13 ELSE IF( ocean.EQ.'couple') THEN13 ELSE IF(type_ocean.EQ.'couple') THEN 14 14 zx_tmp_2d(1:iim,1:jjmp1)=3. 15 15 ENDIF 16 16 CALL histwrite(nid_ctesGCM,"ocean",itau_w, 17 . zx_tmp_2d,iim*jjmp1,ndex2d)18 c19 IF(ok_slab_sicOBS) THEN20 zx_tmp_2d(1:iim,1:jjmp1)=1.21 ELSE22 zx_tmp_2d(1:iim,1:jjmp1)=0.23 ENDIF24 CALL histwrite(nid_ctesGCM,"ok_slab_sicOBS",itau_w,25 17 . zx_tmp_2d,iim*jjmp1,ndex2d) 26 18 c
Note: See TracChangeset
for help on using the changeset viewer.