Opened 10 years ago

Closed 10 years ago

#222 closed task (fixed)

New function to modify parameter files by the driver

Reported by: jgipsl Owned by: jgipsl
Priority: major Milestone: libIGCM_v2.4 metrics
Component: system Version:
Keywords: Cc:

Description

Proposition:
2 new functions in libIGCM replaces the LMDZ_sed, ORCHIDEE_sed, INCA_sed_replace/complete and supergrep(nemo):

Syntax in .driver file:

instead of ORCHIDEE_sed/LMDZ_sed:
IGCM_comp_modifyDefFile  blocker/nonblocker filename key [value]

instead of supergrep:
IGCM_comp_modifyNamelist blocker/nonblocker filename key [value]

Algorithm for the function IGCM_comp_modifyDefFile to be added before IGCM_comp_Update:

IGCM_comp_modifyDefFile{

1) Search for all occurrences of key and their values in all files *.def 
   set in [ParametersFiles]

2) Test for errors: bad placed keys or duplications
If key set several times => stop

If key set in another file than filename
     	  if     blocker    => stop
	  elseif nonblocker => change filname=currentfile, continue


3) Modify key depending on different case

case 1: If value="DEFAULT" or value is not set
        Read to the right of DEFAULT in filename
        if value found, set key=value
	else	   
	    if  blocker    => stop
            if  nonblocker => nothing is done

case 2: key is not set  (=> user removed the key)
     blocker         => stop
     nonblocker      => Nothing is done, keep users modifications

case 3: key=_AUTO (_AUTO_ or _AUTOBLOCKER_) (=> user did not change)
     => change to key=value

case 4: key=X
     nonblocker  => Nothing is done
     blocker     => Stop
}

Algorithm for the function IGCM_comp_modifyNamelist:
as for IGCM_comp_modifyDefFile but read and write adapted for different format.

Change History (5)

comment:1 Changed 10 years ago by jgipsl

IGCM_comp_modifyDefFile done in rev [1069]

IGCM_comp_modifyNamelist not yet done. And maybe a function for modifying xml file is also needed.

comment:2 Changed 10 years ago by jgipsl

IGCM_comp_modifyXmlFile added in rev [1074]. This function also has a type=force : modify the variable even if it is not set to AUTO.

comment:3 Changed 10 years ago by sdipsl

  • Milestone set to libIGCM_v2.4 metrics

We want that in the upcoming tag.

comment:4 Changed 10 years ago by jgipsl

Added option force in IGCM_comp_modifyDefFile rev [1081]

Added IGCM_comp_modifyNamelist rev [1085]

comment:5 Changed 10 years ago by jgipsl

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.