wiki:SwiftWork/DiagDevelopment

Version 1 (modified by jacob, 8 years ago) (diff)

--

How do maintain the swift version and the c-shell version?

First note that C-shell and Swift languages don't look very much alike.

From the original C-shell script:

# save unweighted variables
if ($weight_months == 0) then 
  if ($test_ANN_climo == 0 || $test_MON_climo == 0 || $test_DJF_climo == 0) then 
    set filename = {$conv_test}`printf "%04d" {$test_begin}`-01.nc
    ncks -C -O -v $non_time_vars {$test_path}{$filename} {$WKDIR}test_unweighted.nc
  else 
    if ($test_JJA_climo == 0) then 
      set filename = {$conv_test}`printf "%04d" {$test_begin}`-06.nc
      ncks -C -O -v $non_time_vars {$test_path}{$filename} {$WKDIR}test_unweighted.nc
    endif
  endif
endif

and the swift version:

(file out)Save_Unweighted_Variables(string file_name, string n_t_var, string t_path)
{
        app {ncks "-C" "-O" "-v" n_t_var @strcat(t_path,file_name) @filename(out);}
}
RemoveFiles(file f[])
{
       app {rm "-f" @filenames(f);}

}