Undesired parsing of variables on a job's secondary templates
Hello @dbeltran and @bdepaula,
Autosubmit Version
4.0.105
Expid affected(If applicable)
t0bj
Which task has issues? Where is the log(If applicable)
- Full_name: t0fj_19900101_fc0_1_SIM
Summary
I am working on separating functionality from the main templates in the Auto-ECEarth4 project, in order to cover most of the logic with unit tests. With this purpose I took one of @eferre1's functions and moved most of its operations into a function within a utility script templates/utils/sim.utils.sh
. To move this script along with the template I included it in the SIM's list of files in the jobs configuration yml.
After dealing with a couple of problems with my implementation though, I've noticed that Autosubmit's variable parsing is acting inconsistently. For context, I need to make use of the date -u -d "${startdate} + $(( numchunks * chunksize )) month" +%Y%m%d
command, which worked without issue when it was located in the sim's template, however, after moving it around to the utility script, autosubmit seems to parse the %Y% in the string +%Y%m%d
which is meant to set the format of the command's output, turning it into +m%d
. This basically makes it print an incorrect configuration file containing the "date" m01, in this specific case.
Steps to reproduce
After some testing, it seems that the sim template did not have the %Y% pattern replaced because it was the first FILE listed in the experiment's sim config, as I ran the experiment with the file order changed and it worked as expected. So to reproduce this behaviour I would say it would be enough to source a script containing date -d "18 Nov 2000" %Y%m%d
and listed the second or latter file in the job's configuration.
My experiment is running on HPC2020, so the logs and parsed scripts (with the evidence of autosubmit's odd behaviour) are located at /scratch/c3bg/spesiccf/c3bg/t0fj
if accessing through ashub.
Thanks for your time, Genis Bonet