Ignore:
Timestamp:
Feb 5, 2023, 9:32:11 PM (17 months ago)
Author:
fhourdin
Message:

Lecture possible du relief dans iniacademic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/dyn3dmem/iniacademic_loc.F90

    r4379 r4419  
    2323  USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0
    2424  USE readTracFiles_mod, ONLY: addPhase
     25  use netcdf, only : NF90_NOWRITE,NF90_OPEN,NF90_NOERR,NF90_INQ_VARID
     26  use netcdf, only : NF90_CLOSE, NF90_GET_VAR
     27
    2528
    2629  !   Author:    Frederic Hourdin      original: 15/01/93
     
    6770  real tetajl(jjp1,llm)
    6871  INTEGER i,j,l,lsup,ij, iq, iName, iPhase, iqParent
     72
     73  integer :: nid_relief,varid,ierr
     74  real, dimension(iip1,jjp1) :: relief
     75
    6976
    7077  REAL teta0,ttp,delt_y,delt_z,eps ! Constantes pour profil de T
     
    126133    ! allocate global fields:
    127134!    allocate(vcov_glo(ip1jm,llm))
     135
    128136    allocate(ucov_glo(ip1jmp1,llm))
    129137    allocate(teta_glo(ip1jmp1,llm))
     
    135143     ps_glo(:)=preff
    136144
    137      ! ground geopotential
    138      phis_glo(:)=0.
     145     !------------------------------------------------------------------
     146     ! Lecture eventuelle d'un fichier de relief interpollee sur la grille
     147     ! du modele.
     148     ! On suppose que le fichier relief_in.nc est stoké sur une grille
     149     ! iim*jjp1
     150     ! Facile a créer à partir de la commande
     151     ! cdo remapcon,fichier_output_phys.nc Relief.nc relief_in.nc
     152     !------------------------------------------------------------------
     153
     154     relief=0.
     155     ierr = NF90_OPEN ('relief_in.nc', NF90_NOWRITE,nid_relief)
     156     if (ierr.EQ.NF90_NOERR) THEN
     157         ierr=NF90_INQ_VARID(nid_relief,'RELIEF',varid)
     158         if (ierr==NF90_NOERR) THEN
     159              ierr=NF90_GET_VAR(nid_relief,varid,relief(1:iim,1:jjp1))
     160              relief(iip1,:)=relief(1,:)
     161         else
     162              CALL abort_gcm ('iniacademic','variable RELIEF pas la',1)
     163         endif
     164     endif
     165     ierr = NF90_CLOSE (nid_relief)
     166
     167
     168     !------------------------------------------------------------------
     169     ! Initialisation du geopotentiel au sol et de la pression
     170     !------------------------------------------------------------------
     171
     172     print*,'relief=',minval(relief),maxval(relief),'g=',g
     173     do j=1,jjp1
     174        do i=1,iip1
     175           phis_glo((j-1)*iip1+i)=g*relief(i,j)
     176        enddo
     177     enddo
     178     print*,'phis=',minval(phis),maxval(phis),'g=',g
     179
    139180     CALL pression ( ip1jmp1, ap, bp, ps_glo, p       )
    140181     if (pressure_exner) then
Note: See TracChangeset for help on using the changeset viewer.