Ignore:
Timestamp:
Apr 19, 2022, 12:03:01 PM (3 years ago)
Author:
dbardet
Message:

Using of is_master keyword to allow nly the master processor to write the messages and avoid too heavy output files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/interpolateH2H2.F90

    r2655 r2662  
    2020      use callkeys_mod, only: versH2H2cia, strictboundcia, H2orthopara_mixture
    2121      use datafile_mod, only: datadir
     22      use mod_phys_lmdz_para, only : is_master
    2223
    2324      implicit none
     
    6465      if(temp.gt.400)then
    6566        if (strictboundcia) then
    66           print*,'Your temperatures are too high for this H2-H2 CIA dataset. If you '
    67           print*,'really want to run simulations with hydrogen at T > 400 K, contact'
    68           print*,'Robin Wordsworth [rwordsworth@uchicago.edu].'
     67          if (is_master) then
     68            print*,'Your temperatures are too high for this H2-H2 CIA dataset. If you '
     69            print*,'really want to run simulations with hydrogen at T > 400 K, contact'
     70            print*,'Robin Wordsworth [rwordsworth@uchicago.edu].'
     71          endif
    6972          stop
    7073        else
    71           print*,'Your temperatures are too high for this H2-H2 CIA dataset'
    72           print*,'you have chosen strictboundcia = ', strictboundcia
    73           print*,'*********************************************************'
    74           print*,' we allow model to continue but with temp = 400          '
    75           print*,'  ...       for H2-H2 CIA dataset          ...           '
    76           print*,'  ... we assume we know what you are doing ...           '
    77           print*,'*********************************************************'
     74          if (is_master) then
     75            print*,'Your temperatures are too high for this H2-H2 CIA dataset'
     76            print*,'you have chosen strictboundcia = ', strictboundcia
     77            print*,'*********************************************************'
     78            print*,' we allow model to continue but with temp = 400          '
     79            print*,'  ...       for H2-H2 CIA dataset          ...           '
     80            print*,'  ... we assume we know what you are doing ...           '
     81            print*,'*********************************************************'
     82          endif
    7883          temp = 400
    7984        endif
    8085      elseif(temp.lt.40)then     
    8186        if (strictboundcia) then
    82           print*,'Your temperatures are too low for this H2-H2 CIA dataset. If you '
    83           print*,'really want to run simulations with hydrogen at T < 40 K, contact'
    84           print*,'Robin Wordsworth [rwordsworth@uchicago.edu].'
     87          if (is_master) then
     88            print*,'Your temperatures are too low for this H2-H2 CIA dataset. If you '
     89            print*,'really want to run simulations with hydrogen at T < 40 K, contact'
     90            print*,'Robin Wordsworth [rwordsworth@uchicago.edu].'
     91          endif
    8592          stop
    8693        else
    87           print*,'Your temperatures are too low for this H2-H2 CIA dataset'
    88           print*,'you have chosen strictboundcia = ', strictboundcia
    89           print*,'*********************************************************'
    90           print*,' we allow model to continue but with temp = 40           '
    91           print*,'  ...       for H2-H2 CIA dataset          ...           '
    92           print*,'  ... we assume we know what you are doing ...           '
    93           print*,'*********************************************************'
     94          if (is_master) then
     95            print*,'Your temperatures are too low for this H2-H2 CIA dataset'
     96            print*,'you have chosen strictboundcia = ', strictboundcia
     97            print*,'*********************************************************'
     98            print*,' we allow model to continue but with temp = 40           '
     99            print*,'  ...       for H2-H2 CIA dataset          ...           '
     100            print*,'  ... we assume we know what you are doing ...           '
     101            print*,'*********************************************************'
     102          endif
    94103          temp = 40
    95104        endif           
     
    99108
    100109      if(firstcall)then ! called by sugas_corrk only
    101          print*,'----------------------------------------------------'
    102          print*,'Initialising H2-H2 continuum from HITRAN database...'
     110         if (is_master) print*,'----------------------------------------------------'
     111         if (is_master) print*,'Initialising H2-H2 continuum from HITRAN database...'
    103112
    104113!     1.1 Open the ASCII files and set nS according to version
     
    126135         open(33,file=dt_file,form='formatted',status='old',iostat=ios)
    127136         if (ios.ne.0) then        ! file not found
    128            write(*,*) 'Error from interpolateH2H2'
    129            write(*,*) 'Data file ',trim(dt_file),' not found.'
    130            write(*,*) 'Check that your path to datagcm:',trim(datadir)
    131            write(*,*) 'is correct. You can change it in callphys.def with:'
    132            write(*,*) 'datadir = /absolute/path/to/datagcm'
    133            write(*,*) 'Also check that the continuum data is there.'
     137           if (is_master) then
     138             write(*,*) 'Error from interpolateH2H2'
     139             write(*,*) 'Data file ',trim(dt_file),' not found.'
     140             write(*,*) 'Check that your path to datagcm:',trim(datadir)
     141             write(*,*) 'is correct. You can change it in callphys.def with:'
     142             write(*,*) 'datadir = /absolute/path/to/datagcm'
     143             write(*,*) 'Also check that the continuum data is there.'
     144           endif
    134145           call abort
    135146         else
    136147         
    137148         if(versH2H2cia.eq.2011) then
    138            write(*,*) '... You are using H2-H2 CIA from 2011 but you should use more recent data available on HITRAN !'
    139            write(*,*) '... (Especially if you are running a giant planet atmosphere)'
    140            write(*,*) '... Just find out the H2-H2 CIA from 2018, put it in your datadir and have a look at interpolateH2H2.F90 ! .'
     149           if (is_master) then
     150             write(*,*) '... You are using H2-H2 CIA from 2011 but you should use more recent data available on HITRAN !'
     151             write(*,*) '... (Especially if you are running a giant planet atmosphere)'
     152             write(*,*) '... Just find out the H2-H2 CIA from 2018, put it in your datadir and have a look at interpolateH2H2.F90 ! .'
     153           endif
    141154         endif
    142155
     
    151164
    152165               if(nS.ne.nres)then
    153                   print*,'Resolution given in file: ',trim(dt_file)
    154                   print*,'is ',nres,', which does not match nS.'
    155                   print*,'Please adjust nS value in interpolateH2H2.F90'
     166                  if (is_master) then
     167                    print*,'Resolution given in file: ',trim(dt_file)
     168                    print*,'is ',nres,', which does not match nS.'
     169                    print*,'Please adjust nS value in interpolateH2H2.F90'
     170                  endif
    156171                  stop
    157172               endif
     
    169184!$OMP BARRIER
    170185
    171          print*,'interpolateH2H2: At wavenumber ',wn,' cm^-1'
    172          print*,'   temperature ',temp,' K'
    173          print*,'   pressure ',pres,' Pa'
    174 
     186         if (is_master) then
     187           print*,'interpolateH2H2: At wavenumber ',wn,' cm^-1'
     188           print*,'   temperature ',temp,' K'
     189           print*,'   pressure ',pres,' Pa'
     190         endif
    175191      endif
    176192     
Note: See TracChangeset for help on using the changeset viewer.