(This could be a bug.) I have been setting up a Held-Suarez experiment on Isca, using an input file that contains a local heating source (K/s units). I ran the model with two setups: one with input file, and a control setup without any input file. Then I calculated the difference between the zonal-mean time-averaged zonal winds of both setups. The difference is exactly ZERO. I am not sure if this an accurate output, but it likely isn't. The internal Fortran script (interpolator.F90) does see the input file (any small change in the file creates an array of familiar fatal error in the model). However, I suspect that my script is just interpolating the file and then doing nothing afterwards. I am including the python script. No change is done on either hs_forcing.F90 or interpolator.F90, which are the main Fortran programs it runs under.
Screenshots
REPRODUCIBLE EXAMPLE
Very little is changed from the Held-Suarez test case. Notable changes are the call to
input file option in the namelist parameters, and telling Isca where the file is
import numpy as np
import time
import os
import sys
import glob
from isca import DryCodeBase, DiagTable, Experiment, Namelist, GFDL_BASE
NCORES = 16
RESOLUTION = 'T85', 25
cb = DryCodeBase.from_directory(GFDL_BASE)
cb.compile()
create an Experiment object to handle the configuration of model parameters
if name == 'main':
st = time.time()
exp.run(1, num_cores=NCORES, use_restart=False)
for i in range(2, 2):
exp.run(i, num_cores=NCORES) # use the restart i-1 by default
elapsed_time = time.time() - st
print('Execution time:', time.strftime("%H:%M:%S", time.gmtime(elapsed_time)))
Description
(This could be a bug.) I have been setting up a Held-Suarez experiment on Isca, using an input file that contains a local heating source (K/s units). I ran the model with two setups: one with input file, and a control setup without any input file. Then I calculated the difference between the zonal-mean time-averaged zonal winds of both setups. The difference is exactly ZERO. I am not sure if this an accurate output, but it likely isn't. The internal Fortran script (interpolator.F90) does see the input file (any small change in the file creates an array of familiar fatal error in the model). However, I suspect that my script is just interpolating the file and then doing nothing afterwards. I am including the python script. No change is done on either hs_forcing.F90 or interpolator.F90, which are the main Fortran programs it runs under.
Screenshots
REPRODUCIBLE EXAMPLE
Very little is changed from the Held-Suarez test case. Notable changes are the call to
input file option in the namelist parameters, and telling Isca where the file is
import numpy as np import time import os import sys import glob
from isca import DryCodeBase, DiagTable, Experiment, Namelist, GFDL_BASE
NCORES = 16 RESOLUTION = 'T85', 25
cb = DryCodeBase.from_directory(GFDL_BASE)
cb.compile()
create an Experiment object to handle the configuration of model parameters
and output diagnostics
exp_name = 'jets_ctrl_bam' exp = Experiment(exp_name, codebase=cb)
Tell model how to write diagnostics
diag = DiagTable() diag.add_file('ctrl_bam_local_heating_added', 30, 'days', time_units='days')
Tell model which diagnostics to write
diag.add_field('dynamics', 'ps', time_avg=True) diag.add_field('dynamics', 'bk') diag.add_field('dynamics', 'pk') diag.add_field('dynamics', 'ucomp', time_avg=True) diag.add_field('dynamics', 'vcomp', time_avg=True) diag.add_field('dynamics', 'temp', time_avg=True) diag.add_field('dynamics', 'vor', time_avg=True) diag.add_field('dynamics', 'div', time_avg=True)
exp.diag_table = diag
local_heating='from_file'
local_heating_file='a_file_I_just_invented'
define namelist values as python dictionary
wrapped as a namelist object.
namelist = Namelist({ 'main_nml': { 'dt_atmos': 600, 'days': 3650, 'calendar': 'thirty_day', 'current_date': [2000,1,1,0,0,0] },
})
exp.namelist = namelist exp.set_resolution(*RESOLUTION) exp.inputfiles = [os.path.join('/data/jmartinezclaros/local_heating.nc')]
Run
if name == 'main': st = time.time() exp.run(1, num_cores=NCORES, use_restart=False) for i in range(2, 2): exp.run(i, num_cores=NCORES) # use the restart i-1 by default elapsed_time = time.time() - st print('Execution time:', time.strftime("%H:%M:%S", time.gmtime(elapsed_time)))
END OF EXAMPLE
########################################################################################