Ignore:
Timestamp:
Sep 19, 2018, 10:53:15 AM (7 years ago)
Author:
emillour
Message:

Dynamico-physics interfaces:

  • some OpenMP fixes.
  • small bug fix: in Dynamico vertical flux is positive when upwards, but in the physics positive is downwards, so change the sign when sending values to the physics.

EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/ICOSA_LMDZ/src/phystd/interface_icosa_lmdz.f90

    r1982 r2000  
    255255    ENDDO
    256256
    257 !$OMP BARRIER
    258257     
    259258    CALL transfer_icosa_to_lmdz(f_ind_cell_glo,ind_cell_glo)
     
    276275
    277276    ! Initialize tracer names, numbers, etc. for physics
    278 !$OMP MASTER
    279277    !Config  Key  = type_trac
    280278    !Config  Desc = Choix de couplage avec model de chimie INCA ou REPROBUS
     
    290288!    nqo=2
    291289!    nbtr=2
     290!$OMP MASTER
    292291    ALLOCATE(tname(nqtot))
     292!$OMP END MASTER
     293!$OMP BARRIER
    293294!    ALLOCATE(ttext(nqtot))
    294295!    ALLOCATE(niadv(nqtot))
     
    299300
    300301! read tname() from traceur.def file
     302    IF (is_mpi_root) THEN
     303!$OMP MASTER
    301304    OPEN(unit=42,file="traceur.def",form="formatted",status="old",iostat=ierr)
    302305    IF (ierr==0) THEN
     
    313316!$OMP END MASTER
    314317!$OMP BARRIER
     318    ENDIF ! of (is_mpi_root)
     319
     320    DO i=1,nqtot
     321      CALL bcast(tname(i))
     322    ENDDO
    315323
    316324!    CALL init_infotrac_phy(nqtot,nqo,nbtr,tname,ttext,type_trac,&
     
    325333!    CALL inifis(klon_omp,nlayer,nqtot,pdayref,punjours,nday,ptimestep, &
    326334!            latitude,longitude,cell_area,prad,pg,pr,pcpp)
    327 !$OMP MASTER
    328335
    329336    startphy_file=.true.
     
    332339    IF (startphy_file) THEN
    333340
     341      IF (is_mpi_root) THEN
     342!$OMP MASTER     
    334343      status=nf90_open('startfi.nc',NF90_NOWRITE,ncid)
    335344      if (status.ne.nf90_noerr) then
     
    348357      status=nf90_get_var(ncid,varid,tab_cntrl)
    349358      start_day=tab_cntrl(3)
    350       print*,"start_day YORGL",start_day
     359      print*,"initialize_physics_omp: start_day",start_day
    351360      status=nf90_close(ncid)
     361!$OMP END MASTER     
     362!$OMP BARRIER
     363      ENDIF ! of !IF (is_mpi_root)
     364     
     365      CALL bcast(start_day)
    352366
    353367    ELSE
     
    364378    ndays=nint(itaumax*(dt/day_length))! number of days to run
    365379    physics_timestep=dt*itau_physics
    366 !$OMP END MASTER
    367 !$OMP BARRIER
     380
    368381    CALL inifis(klon_omp,llm,nqtot,start_day,day_length,ndays,physics_timestep, &
    369382            latfi,lonfi,airefi,radius,g,kappa*cpp,cpp)
     
    596609
    597610    DO l=1,llm
    598       wflux_phy(:,l)=wflux_phy(:,l)*cell_area(:)
     611      ! Warning: In the physics, vertical flux convention is positive if downwards!
     612      wflux_phy(:,l)= - wflux_phy(:,l)*cell_area(:)
     613      ! Compute relative geopotential
    599614      phi_phy(:,l)=phi_phy(:,l)-phis_phy(:)
    600615    ENDDO
Note: See TracChangeset for help on using the changeset viewer.