Changeset 4008 for trunk


Ignore:
Timestamp:
Jan 14, 2026, 8:30:16 PM (10 days ago)
Author:
aslmd
Message:

MESOSCALE: use precompiling flags to hide instructions related to parallel computations (we consider physics as being like a 1D model without any attached dynamical core when we compile).

Location:
trunk/LMDZ.MARS/libf/phymars
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/albedocaps.F90

    r3901 r4008  
    1414use surfdat_h, only: TESicealbedo, TESice_Ncoef, TESice_Scoef, &
    1515                     emisice, emissiv, albedice, albedodat, albedo_perennialco2
     16#ifndef MESOSCALE
    1617USE mod_phys_lmdz_transfert_para, ONLY: bcast
    1718USE mod_phys_lmdz_para, ONLY: is_master
     19#endif
    1820USE paleoclimate_mod, ONLY: paleoclimate
    1921
     
    134136use netcdf, only: nf90_open, NF90_NOWRITE, NF90_NOERR, &
    135137                  nf90_strerror, nf90_inq_varid, nf90_get_var, nf90_close
     138#ifndef MESOSCALE
    136139USE mod_phys_lmdz_para, ONLY: is_master
    137140USE mod_phys_lmdz_transfert_para, ONLY: bcast
     141#endif
    138142
    139143implicit none
     
    145149real:: pi,radeg ! to convert radians to degrees
    146150character(len=20),parameter :: modname="TES_icecap_albedo"
     151
    147152
    148153! TES datasets: (hard coded fixed length/sizes; for now)
     
    171176
    172177! 0. Preliminary stuff
    173 
     178#ifndef MESOSCALE
    174179if(is_master) then
    175 
     180#endif
    176181! Load TES albedoes for Northern Hemisphere
    177182  ierr=nf90_open(trim(datadir)//"/npsc_albedo.nc",NF90_NOWRITE,nid)
     
    244249    endif
    245250  endif
    246 
    247251  ierr=nf90_close(nid)
    248252
     
    298302  zls_old=-999 ! dummy initialization
    299303
     304#ifndef MESOSCALE
    300305endif !is_master
    301306
     
    309314    call bcast(zls_old)
    310315    call bcast(radeg)
     316#endif
    311317
    312318end subroutine read_TES_icecap_albedo
  • trunk/LMDZ.MARS/libf/phymars/conf_phys.F

    r3923 r4008  
    3737     &                          reff_driven_IRtoVIS_scenario
    3838      use aeropacity_mod, only: iddist, topdustref
     39#ifndef MESOSCALE
    3940      USE mod_phys_lmdz_transfert_para, ONLY: bcast
     41#endif
    4042      USE paleoclimate_mod,ONLY: paleoclimate,
    4143     &                           lag_layer, include_waterbuoyancy
     
    128130      CLOSE(99)
    129131!$OMP END MASTER
     132#ifndef MESOSCALE
    130133      call bcast(ierr)
     134#endif
    131135!       ierr=0
    132136     
     
    13351339      CLOSE(99)
    13361340!$OMP END MASTER
     1341#ifndef MESOSCALE
    13371342      call bcast(ch1)
    13381343      call bcast(callemis)
     
    13461351      call bcast(callg2d)
    13471352      call bcast(semi)
     1353#endif
    13481354
    13491355      END SUBROUTINE conf_phys
  • trunk/LMDZ.MARS/libf/phymars/dustdevil.F90

    r3292 r4008  
    1616    use surfdat_h, only: z0_default
    1717    USE comcstfi_h, ONLY: g, cpp, r, rcp
     18#ifndef MESOSCALE
    1819    USE mod_phys_lmdz_para, ONLY: is_master, bcast
     20#endif
    1921    USE ioipsl_getin_p_mod, ONLY : getin_p
    2022    IMPLICIT NONE
     
    7577!$OMP THREADPRIVATE(q2top,seuil)
    7678
     79
    7780!-----------------------------------------------------------------------
    7881!    initialisation
     
    9396        call abort_physic(rname,"bad dust_devil_scheme value",1)
    9497      endif
    95 
     98#ifndef MESOSCALE
    9699      if(is_master) then
    97 
     100#endif
    98101        write(*,*) 'In dustdevil :'
    99102        write(*,*) '    q2top= ',q2top,'     seuil= ', seuil
     
    108111!       Temporaire
    109112!       open(77,file='devil')
    110      
     113#ifndef MESOSCALE     
    111114      endif !is_master
    112115
     
    114117      CALL bcast(z1)
    115118      CALL bcast(Cd)
     119#endif
    116120
    117121      firstcall=.false.
  • trunk/LMDZ.MARS/libf/phymars/nirdata.F90

    r3006 r4008  
    2323
    2424    use datafile_mod, only: datadir
     25#ifndef MESOSCALE
    2526    USE mod_phys_lmdz_para, ONLY: is_master
    2627    USE mod_phys_lmdz_transfert_para, ONLY: bcast
    27 
     28#endif
    2829    implicit none
    2930
     
    3132
    3233    integer :: ind
    33 
     34#ifndef MESOSCALE
    3435    if (is_master) then
     36#endif
    3537      open(43,file=trim(datadir)//'/NIRcorrection_feb2011.dat', &
    3638             status='old')
     
    4648      enddo
    4749      close(43)
    48 
     50#ifndef MESOSCALE
    4951    endif !  if(is_master) then
    50 
    5152    call bcast(pres1d)
    5253    call bcast(corgcm)
     
    5455    call bcast(p1999)
    5556    call bcast(alfa)
    56 
     57#endif
    5758  end subroutine NIR_leedat
    5859
  • trunk/LMDZ.MARS/libf/phymars/nlte_aux.F

    r3018 r4008  
    23302330c     *******************************************************************
    23312331
    2332       subroutine rhist_03 (ihist)
     2332      subroutine rhist_03 (ihist)
     2333#ifndef MESOSCALE
    23332334      USE mod_phys_lmdz_para, ONLY: is_master
    23342335      USE mod_phys_lmdz_transfert_para, ONLY: bcast
     2336#endif
    23352337
    23362338c     *******************************************************************
     
    23472349      integer         j, r
    23482350      real*8          xx
     2351#ifdef MESOSCALE
     2352      logical :: is_master=.true.
     2353#endif
    23492354
    23502355c     ***************
    23512356
     2357#ifndef MESOSCALE
    23522358      if(is_master) then
    2353 
     2359#endif
    23542360      open(unit=3,file=hisfile,status='old')
    23552361
     
    23802386
    23812387      close(unit=3)
    2382 
     2388#ifndef MESOSCALE
    23832389      endif !      if(is_master)
    2384 
    23852390      call bcast(mm_stored)
    23862391      call bcast(nbox_stored)
     
    23912396      call bcast(xls1_stored)
    23922397      call bcast(xld1_stored)
    2393 
     2398#endif
    23942399      end subroutine rhist_03
    23952400
  • trunk/LMDZ.MARS/libf/phymars/nlte_setup.F

    r3018 r4008  
    2525
    2626      use datafile_mod, only: datadir
     27#ifndef MESOSCALE
    2728      USE mod_phys_lmdz_para, ONLY: is_master
    2829      USE mod_phys_lmdz_transfert_para, ONLY: bcast
     30#endif
    2931      use nlte_paramdef_h, only: nztabul, nb, nisot, indexisot
    3032      use nlte_commons_h, only: elow, deltanu, lnpnbtab, tstar11tab
     
    4345      character isotcode*2
    4446
    45 
    4647c     formats
    4748 132  format (i2)
     
    5758      lun2 = 2
    5859
     60#ifndef MESOSCALE
    5961      if(is_master) then
    60 
     62#endif
    6163      do k=1,nisot
    6264         write (isotcode,132) indexisot(k)
     
    7476         close (lun2)
    7577      end do
    76 
     78#ifndef MESOSCALE
    7779      endif !      if(is_master)
    7880
    7981      call bcast(elow)
    8082      call bcast(deltanu)
     83#endif
    8184
    8285      a1_010_000 = 1.3546d00
     
    8891
    8992c     *** Old LeeESCTVCISO_dlvr11 ***
    90 
     93#ifndef MESOSCALE
    9194      if(is_master) then
    92 
     95#endif
    9396      open( 11, file=trim(datadir)//
    9497     $     '/NLTEDAT/parametp_Tstar_IAA1204.dat' )
     
    108111      close (12)
    109112
    110 
     113#ifndef MESOSCALE
    111114      endif !is_master
    112115
     
    120123      call bcast(vc310tab)
    121124      call bcast(vc410tab)
     125#endif
    122126
    123127      xx=xx
  • trunk/LMDZ.MARS/libf/phymars/phys_state_var_init_mod.F90

    r3393 r4008  
    6666      use paleoclimate_mod, ONLY: end_paleoclimate_h,ini_paleoclimate_h
    6767      use netcdf
     68#ifndef MESOSCALE
    6869      USE mod_phys_lmdz_para, ONLY: is_master,bcast
     70#endif
    6971
    7072      IMPLICIT NONE
     
    8284      integer       :: nslope_read
    8385
     86
    8487      filename = "startfi.nc"
     88#ifndef MESOSCALE
    8589      if(is_master) then
     90#endif
    8691        status = nf90_open(filename, nf90_nowrite, ncid)
    8792        if (status /= nf90_noerr) then
     
    100105          endif
    101106        endif
     107#ifndef MESOSCALE
    102108      endif
    103109      call bcast(nslope)
     110#endif
    104111
    105112      ! set dimension and allocate arrays in tracer_mod
  • trunk/LMDZ.MARS/libf/phymars/planetwide_mod.F90

    r1507 r4008  
    55! module which contains functions to obtain max/min/... values over the
    66! entire globe (trivial in serial mode, but not in parallel)
    7 
     7#ifndef MESOSCALE
    88use mod_phys_lmdz_para, only : is_master, gather, bcast
    99                               
     
    295295  end subroutine planetwide_sumval_r2
    296296 
    297  
     297#endif 
    298298end module planetwide_mod
  • trunk/LMDZ.MARS/libf/phymars/read_dust_scenario_mod.F90

    r3726 r4008  
    1414use dust_param_mod, only: odpref, dustscaling_mode
    1515use planete_h, only: year_day
     16#ifndef MESOSCALE
    1617USE mod_phys_lmdz_transfert_para, ONLY: bcast
     18#endif
    1719use callkeys_mod, only: iaervar, dustinjection, swrtype
    1820
     
    124126!$OMP END MASTER
    125127
     128#ifndef MESOSCALE
    126129   call bcast(lonlen)
    127130   call bcast(latlen)
    128131   call bcast(timelen)
     132#endif
    129133
    130134   if (.not.allocated(tautes)) allocate(tautes(lonlen,latlen,timelen))
     
    200204!$OMP END MASTER
    201205
     206#ifndef MESOSCALE
    202207   call bcast(tautes)
    203208   call bcast(time)
     
    205210   call bcast(lon)
    206211   call bcast(IRscenario)
    207 
     212#endif
    208213endif ! of if (firstcall)
    209214
  • trunk/LMDZ.MARS/libf/phymars/suaer.F90

    r3756 r4008  
    1919                    nsize
    2020use datafile_mod, only: datadir
     21#ifndef MESOSCALE
    2122USE mod_phys_lmdz_transfert_para, ONLY: bcast
     23#endif
    2224use callkeys_mod, only: dustrefir
    2325use aerave_mod, only: aerave
     
    559561!$OMP END MASTER
    560562
     563#ifndef MESOSCALE
    561564      call bcast(longrefvis)
    562565      call bcast(longrefir)
     
    573576      call bcast(omegaREFir)
    574577      call bcast(nsize)
     578#endif
    575579
    576580!==================================================================
Note: See TracChangeset for help on using the changeset viewer.