Skip to content

Commit

Permalink
Skip component if it has no input files.
Browse files Browse the repository at this point in the history
  • Loading branch information
IngoBethke committed Sep 4, 2017
1 parent a3015ee commit 34e7ebd
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 10 deletions.
12 changes: 11 additions & 1 deletion source/m_modelsatm.F
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ SUBROUTINE atm2cmor
c
c --- Read grid information from input files
itag=tagamon
CALL scan_files(reset=.TRUE.)
IF (LEN_TRIM(fnm).EQ.0) RETURN
CALL read_gridinfo_ifile
c
c --- Initialise pressure level dimension
Expand Down Expand Up @@ -783,7 +785,11 @@ SUBROUTINE special_pre
c --- - Set N_AER units
CASE ('cm-3')
vunits='cm-3'
c
c
c --- - Convert degress Celsius to K
CASE ('Celsius2Kelvin')
vunits='K'
c
c --- - Convert units from radians2 to m2
CASE ('rad2m')
vunits='m2'
Expand Down Expand Up @@ -847,6 +853,10 @@ SUBROUTINE special_post
ENDIF
SELECT CASE (str1)
c
c --- - Convert degress Celsius to K
CASE ('Celsius2Kelvin')
ofld=ofld+273.15
c
c --- - CO2 units
CASE ('co2units')
ofld=ofld*1e6*29./(12.+2.*16.)
Expand Down
40 changes: 31 additions & 9 deletions source/m_modelsice.F
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ SUBROUTINE ice2cmor
c --- Read grid information from input files
WRITE(*,*) 'Read grid information from input files'
itag=tagimon
CALL scan_files(reset=.TRUE.)
IF (LEN_TRIM(fnm).EQ.0) RETURN
CALL read_gridinfo_ifile
c
c --- Read Fram Strait grid information from secindex.dat
Expand Down Expand Up @@ -426,6 +428,10 @@ SUBROUTINE special_pre
c --- - Fix micrometers units
CASE ('micrometer')
vunits='micrometers'
c
c --- - Convert degC to K
CASE ('Celsius2Kelvin')
vunits='K'
c
c --- - Fix m-2 units
CASE ('m-2')
Expand Down Expand Up @@ -487,6 +493,10 @@ SUBROUTINE special_post
c --- - Convert units from radians2 to m2
CASE ('rad2m')
fld=fld*6.37122e6**2
c
c --- - Convert degC to K
CASE ('Celsius2Kelvin')
fld=fld+273.15
c
c --- - Unit transformation: cm day-1 -> kg m-2 s-1
CASE ('cmFW day-1 -> kg m-2 s-1')
Expand Down Expand Up @@ -597,17 +607,29 @@ SUBROUTINE read_gridinfo_ifile
status=nf90_get_var(ncid,rhid,uvlat)
CALL handle_ncerror(status)
status=nf90_inq_varid(ncid,'ANGLE',rhid)
CALL handle_ncerror(status)
status=nf90_get_var(ncid,rhid,angle)
CALL handle_ncerror(status)
IF (status.EQ.NF90_NOERR) THEN
status=nf90_get_var(ncid,rhid,angle)
CALL handle_ncerror(status)
ELSE
WRITE(*,*) 'ANGLE not in sea ice file. Setting to zero.'
angle=0
ENDIF
status=nf90_inq_varid(ncid,'tarea',rhid)
CALL handle_ncerror(status)
status=nf90_get_var(ncid,rhid,tarea)
CALL handle_ncerror(status)
IF (status.EQ.NF90_NOERR) THEN
status=nf90_get_var(ncid,rhid,tarea)
CALL handle_ncerror(status)
ELSE
WRITE(*,*) 'tarea not in sea ice file. Setting to one.'
tarea=1
ENDIF
status=nf90_inq_varid(ncid,'uarea',rhid)
CALL handle_ncerror(status)
status=nf90_get_var(ncid,rhid,uarea)
CALL handle_ncerror(status)
IF (status.EQ.NF90_NOERR) THEN
status=nf90_get_var(ncid,rhid,uarea)
CALL handle_ncerror(status)
ELSE
WRITE(*,*) 'uarea not in sea ice file. Setting to one.'
uarea=1
ENDIF
c
c --- Read calendar info (override/change units)
status=nf90_inq_varid(ncid,'time',rhid)
Expand Down
2 changes: 2 additions & 0 deletions source/m_modelslnd.F
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ SUBROUTINE lnd2cmor
c --- Read grid information from input files
WRITE(*,*) 'Read grid information from input files'
itag=taglmon
CALL scan_files(reset=.TRUE.)
IF (LEN_TRIM(fnm).EQ.0) RETURN
CALL read_gridinfo_ifile
c
c --- Process table fx
Expand Down
2 changes: 2 additions & 0 deletions source/m_modelsocn.F
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ SUBROUTINE ocn2cmor
c --- Read grid information from input files
WRITE(*,*) 'Read grid information from input files'
itag=tagomon
CALL scan_files(reset=.TRUE.)
IF (LEN_TRIM(fnm).EQ.0) RETURN
CALL read_gridinfo_ifile
c
c --- Process table fx
Expand Down

0 comments on commit 34e7ebd

Please sign in to comment.