! ! $Id: $ ! SUBROUTINE phyredem (fichnom) USE dimphy USE mod_grid_phy_lmdz USE mod_phys_lmdz_para USE iophy USE phys_state_var_mod USE iostart, only : open_restartphy,close_restartphy, & enddef_restartphy,put_var,put_field use geometry_mod, only: longitude_deg, latitude_deg USE time_phylmdz_mod, only: day_end, annee_ref, itau_phy, raz_date use nonoro_gwd_ran_mod, only: du_nonoro_gwd, dv_nonoro_gwd, & east_gwstress, west_gwstress use age_of_air_mod, only: ok_aoa use tabcontrol_mod, only: dtime, radpas, length use soil_mod, only: nsoilmx use clesphys_mod implicit none character(len=*),intent(in) :: fichnom REAL :: tab_cntrl(length) integer :: isoil CHARACTER(len=2) :: str2 integer :: pass ! open file CALL open_restartphy(fichnom) ! tab_cntrl() contains run parameters tab_cntrl(:)=0.0 tab_cntrl(1) = dtime tab_cntrl(2) = radpas tab_cntrl(3) = 0.0 tab_cntrl(4) = 0 tab_cntrl(5) = 0 tab_cntrl(6) = nbapp_rad IF( cycle_diurne ) tab_cntrl( 7 ) = 1. IF( soil_model ) tab_cntrl( 8 ) = 1. IF( ok_orodr ) tab_cntrl(10 ) = 1. IF( ok_orolf ) tab_cntrl(11 ) = 1. IF( ok_gw_nonoro ) tab_cntrl(12 ) = 1. tab_cntrl(13) = day_end tab_cntrl(14) = annee_ref tab_cntrl(15) = itau_phy ! write data to file DO pass=1,2 ! pass=1 netcdf definition ; pass=2 netcdf write CALL put_var(pass,"controle","Parametres de controle",tab_cntrl) ! coordinates CALL put_field(pass,"longitude", & "Longitudes de la grille physique",longitude_deg) CALL put_field(pass,"latitude", & "Latitudes de la grille physique",latitude_deg) ! variables CALL put_field(pass,"TS","Temperature de surface",ftsol) DO isoil=1, nsoilmx IF (isoil.LE.99) THEN WRITE(str2,'(i2.2)') isoil CALL put_field(pass,"Tsoil"//str2, & "Temperature du sol No."//str2,ftsoil(:,isoil)) ELSE PRINT*, "Too many soil layers" CALL abort ENDIF ENDDO CALL put_field(pass,"ALBE","albedo de surface",falbe) CALL put_field(pass,"solsw","Rayonnement solaire a la surface",solsw) CALL put_field(pass,"sollw","Rayonnement IR a la surface",sollw) CALL put_field(pass,"fder","Derive de flux",fder) CALL put_field(pass,"dlw","Derivee flux IR",dlw) CALL put_field(pass,"sollwdown","Flux IR vers le bas a la surface",sollwdown) CALL put_field(pass,"RADS","Rayonnement net a la surface",radsol) CALL put_field(pass,"ZMEA","zmea Orographie sous-maille",zmea) CALL put_field(pass,"ZSTD","zstd Orographie sous-maille",zstd) CALL put_field(pass,"ZSIG","zsig Orographie sous-maille",zsig) CALL put_field(pass,"ZGAM","zgam Orographie sous-maille",zgam) CALL put_field(pass,"ZTHE","zthe Orographie sous-maille",zthe) CALL put_field(pass,"ZPIC","zpic Orographie sous-maille",zpic) CALL put_field(pass,"ZVAL","zval Orographie sous-maille",zval) CALL put_field(pass,"Q2","Turbulent Kinetic Energy",q2) CALL put_field(pass,"TANCIEN","T Previous iteration",t_ancien) ! Non-orographic gavity waves if (ok_gw_nonoro) then call put_field(pass,"du_nonoro_gwd","Zonal wind tendency due to GW",du_nonoro_gwd) call put_field(pass,"dv_nonoro_gwd","Meridional wind tendency due to GW",dv_nonoro_gwd) call put_field(pass,"east_gwstress","Eastward stress profile due to GW",east_gwstress) call put_field(pass,"west_gwstress","Westward stress profile due to GW",west_gwstress) endif if (ok_aoa) then call put_field(pass,"age","Age of air",age) endif ! end definition mode or close file IF (pass==1) CALL enddef_restartphy IF (pass==2) CALL close_restartphy ENDDO ! DO pass=1,2 ! pass=1 netcdf definition ; pass=2 netcdf write !$OMP BARRIER END SUBROUTINE phyredem