Changeset 4419


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

Lecture possible du relief dans iniacademic

Location:
LMDZ6/trunk/libf
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/dyn3d/iniacademic.F90

    r4379 r4419  
    2222  USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0
    2323  USE readTracFiles_mod, ONLY: addPhase
     24  use netcdf, only : NF90_NOWRITE,NF90_OPEN,NF90_NOERR,NF90_INQ_VARID
     25  use netcdf, only : NF90_CLOSE, NF90_GET_VAR
     26
    2427
    2528  !   Author:    Frederic Hourdin      original: 15/01/93
     
    6366  real tetajl(jjp1,llm)
    6467  INTEGER i,j,l,lsup,ij, iq, iName, iPhase, iqParent
     68
     69  integer :: nid_relief,varid,ierr
     70  real, dimension(iip1,jjp1) :: relief
    6571
    6672  REAL teta0,ttp,delt_y,delt_z,eps ! Constantes pour profil de T
     
    118124  CALL inifilr
    119125
     126
     127  !------------------------------------------------------------------
    120128  ! Initialize pressure and mass field if read_start=.false.
     129  !------------------------------------------------------------------
     130
    121131  IF (.NOT. read_start) THEN
     132
     133     !------------------------------------------------------------------
     134     ! Lecture eventuelle d'un fichier de relief interpollee sur la grille
     135     ! du modele.
     136     ! On suppose que le fichier relief_in.nc est stoké sur une grille
     137     ! iim*jjp1
     138     ! Facile a créer à partir de la commande
     139     ! cdo remapcon,fichier_output_phys.nc Relief.nc relief_in.nc
     140     !------------------------------------------------------------------
     141
     142     relief=0.
     143     ierr = NF90_OPEN ('relief_in.nc', NF90_NOWRITE,nid_relief)
     144     if (ierr.EQ.NF90_NOERR) THEN
     145         ierr=NF90_INQ_VARID(nid_relief,'RELIEF',varid)
     146         if (ierr==NF90_NOERR) THEN
     147              ierr=NF90_GET_VAR(nid_relief,varid,relief(1:iim,1:jjp1))
     148              relief(iip1,:)=relief(1,:)
     149         else
     150              CALL abort_gcm ('iniacademic','variable RELIEF pas la',1)
     151         endif
     152     endif
     153     ierr = NF90_CLOSE (nid_relief)
     154
     155     !------------------------------------------------------------------
     156     ! Initialisation du geopotentiel au sol et de la pression
     157     !------------------------------------------------------------------
     158
     159     print*,'relief=',minval(relief),maxval(relief),'g=',g
     160     do j=1,jjp1
     161        do i=1,iip1
     162           phis((j-1)*iip1+i)=g*relief(i,j)
     163        enddo
     164     enddo
     165     print*,'phis=',minval(phis),maxval(phis),'g=',g
     166
     167     ! ground geopotential
     168     !phis(:)=0.
    122169     ps(:)=preff
    123 
    124      ! ground geopotential
    125      phis(:)=0.
    126170     CALL pression ( ip1jmp1, ap, bp, ps, p       )
    127171
  • 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.