MVLib - Short Writeup - Version 4.0
Setting of internal parameters - Last update: September, 11 2013
Source code available for local users only
All the MVLib internal parameters can be set by a call to mvsetflags routine as follow:
call mvsetflags(flag,value)
the first argument is a string specifying the parameter to set, the second argument is a real input variable specifying the value. The string parameter flag passed to mvsetflags can assume the values listed in the following table, note that the string parameter flag is NOT case sensitive, also note that the second argument must always be passed as a real value, also if an integer parameter must be set. Other routines to manipulate internal MVLib parameters are described below the following table.
General Pourpose flags
Log Level The log level is usually set to zero and most of MVLib does not produce any output on stout. If this flag is increased MVLib "explains" what they are doing.
Data Style This flag allows to set the style used by string manipulation routines to produce the date. Depending on the value of this flag the date string is built as follow:
  • 0 date is of type: lunedi' 1 Febbraio 2001
  • 1 date is of type: 1 Febbraio 2001
  • 2 date is of type: February 1, 2001 (default)
  • 3 date is of type: Monday February, 1 2001
  • 4 date is of type: Monday February, 1 2001 GMT
  • 5 date is of type: Monday February, 1 2001 CEST
  • 6 date is of type: Feb 1, 2001
  • 7 date is of type: Feb 1
  • 8 date is of type: Feb11
Century This flag affects the behaviour of string manipulation routines when they produce the date strins. The default is that years ranging from 50 to 99 belongs 20 XXth century and years ranging from 0 to 49 belongs 20 XXIth century.
Calendar Establish the type of calendar to be used. If it is set to 0 (default) the actual calendar is used; if this flag is set to 1 the leap years are not considered (february is always 28 days long); if this flag is set to 2 all the months are considered 30 days long).
General Pourpose flags affecting graphic subroutines
X Size This parameter allows to specify the size (in pixel) of the next picture. (def=600).
X left
X right
Y bottom
Y top
A group of four parameters allowing to select the portion of graphics that will be used for the next plot. All these parameters can be set by a call to the subroutine mvsetplotframe. See also the example 19
Palette di colori This parameter allows to specify the palette color to be used to produce next plot, see also the palette page and the example 44 for the details. Please note: it is important to set this parameter before to call any graphic routines.
Numero di colori This parameter allows to set the numner of colours of the palette. See also the palette page and the example 44 for a detailed description.
Colore Sfondo If this parameter is set to 0 (default) the background color is white and color number 1 is black, the opposite occurs if the value of this parameter is set to any other value.
Colore Sfondo Plot This parameters affects the plotta subpackage and allows to set the background colour of the plot. See the examples 22 and 23.
Displayplot Format Used to define the format of graphic output by the suroutines Displayplot (older name was visualizzaplot). If this flag is set to 0 graphic files are produced in bmp format; if it is set to 1 gif format is used; if it is set to 2 tiff format is used; if it is set to 3 (default) jpg format is used.
Displayplot Behaviour If this flag is set to 0 (default) displayplot routine will display the plots, otherwise each plot is saved in file called tmpNNN being NNN an increasing number. The extension of file name (and therefore the format) depends on the value of Displayplot Format flag.
Tipo di Carattere This parameter must be set with a negative value specifying the set of graphic characters to be used for next string, usually it is set before to call the scrivisulplot routine. See the example 11 for details.
Size del Carattere This parameter also affects the graphic characters specifying the width of the lines used to produce the characters. See also the man pages of NCAR Graphic routine gschxp.
Size delle Scritte It is an integer parameter specifying the size to be used for next string, usually it is set before to call the scrivisulplot routine. See the example 12 for details.
Colore Titoli It is an integer parameter specifying the color index to be used for next string, usually it is set before to call the scrivisulplot routine. See the example 12 for details.
Colore Assi It is an integer parameter specifying the color index to be used for the axis of all kind of 1-D plots.
Plot Confini This flag allows to select the political/geographical boundaries to be plotted with MM5/CHyM 2-dimensional plots
  1. Italian geographical boundaries and regions administrativ boundaries
  2. Italian geographical boundaries and province administrativ boundaries
  3. Italian geographical boundaries
  4. European geographical boundaries
  5. European geographical and political boundaries
  6. World geographical boundaries
  7. World geographical and political boundaries
  8. European geographical boundaries and Italian regions boundaries
  9. European geographical and political boundaries and Italian regions boundaries
default is 0 (no boundaries are plotted).
Logo This flag allows to select a logo to add to the plot in the upper left corner. Valid values must be in the range 1-6 and the logos are selected as follow:
  1. The logo of Abruzzo Science Park is added to plot;
  2. The new logo of CHyM model is added to plot;
  3. The logo of Abruzzo Region is added to plot;
  4. The logo of Cetemps is added to plot;
  5. The old logo of CHyM model is added to plot;
  6. The logo of Bertino is added to plot;
The cited logos follow
Flags affecting MM5 Graphics
Step Freccette This flag affects the subroutines mm5freccette and mm5freccetelle allowing to set the grid step to be used to plot the arrowsi or wind barbs. If it is set to 1 (default) an arrow is plot for each grid point. See also the example 2.
Colore Freccette This flag affects the subroutine mm5freccette allowing to set the color of the arrows. See also the example 2.
Colore Freccetelle This flag affects the subroutine mm5freccetelle allowing to set the color of the arrows. See also the example 3.
Misura vento This flag affects the subroutine mm5freccette allowing to set if the wind is passed as m/sec (this flag = 1, default) or Km/h.
Label Bar This flag affects the subroutine mm5colormap allowing to set the style of label bar. If it is set to 1 (default) MVLib style is used, if it is set to 0 NCAR graphic style is used, with other values labl bar is not produced.
Label Direction This flag affects the subroutine mm5colormap allowing to choose if the label bar must be produced in the horizontal (1) or vertical (2) direction. Default is horizontal for domani number 1 and vertical for other domains.
Primo colore This flag allows to set the first color to be used producing the label bar. See also the example 1
Ogni quanti colori This flag allows to set the step to be used producing the label bar, the default is 1 and therefore all the colours are included in the palette. See also the example 1
Domain This flag allows to select the MM5 operational domain to be used for different graphic routines. This flag is usually automatically set by MuSEO or mm5readfield subroutines.
Check Landuse This flag allows to establish if the subroutines ginterp and closest must consider only the land points (not sea points) in the interpolation.
Confini NCAR This flag is an old one, probably obsolete at this stage. By default it is not activated (the value is lower than zero); if it si activated the graphic routines plotting MM5 will also draw the geographical and/or policatical boundaries following NCAR graphic style.
Flags affecting One-dimensional plot
Asse X This flag allow to establish the kind of labels of X-axis, if you do not want the default labels you may top set this flag as follow:
  1. Label refer to daytime, in this case the value greater than 24 are consequently scaled
  2. Labels refer to days of months in the range 0-31
  3. No labels
  4. Labels refer to days of months in any ranges
  5. Labels refer to the months of year
See also the example 32.
Asse Y Same as previous flag but for Y-Axis. See also the example 32.
Current Month In order to have the days of the month as labels of X and Y axisr (see previous two flags), you usally have to set the first month of the plot and consequently the lenght of such month. See also the example 32.
Size delle linee This flags allows to set the size of the curve. See also the example 32.
Flags affecting Two-dimensional plot
Flags affecting specific subroutines
Displayplot Behaviour This flag affects the routine Displayplot, if it is set to zero (default) this routine will visualize the plot, otherwise it will be saved with the name tmpXXX.EXT where XXX is an increasing integer and EXT is the extension determinated by the value of Displayplot Format flag.
Histogram Color An integer code specifying the color to be used to plot next histogram by mvbookplot subroutine. See also the examples 18 and 19.
Histogram Background An integer code specifying the type of background to be drawn by mvbookplot subroutine. The value "1" specifies a "perimeter" background, the value "2" specifies a "grid" background, the value "3" specifies a "half-axis" background, the value "4" specifies no background at all. See also the examples 18 and 19.
Histogram Statistic If this is flag is greater than zero the mvbookplot subroutine will add to the histogram the statistic about the average value and the number of entries used to produce the histogram. This flag is activated in the example 18 while it is suppressed in the example 19.
Taylorplot sigma Specifies the number of sigma to be displayed for Taylor histograms, if it is set to zero (default) the number of sigma are automatically calculated form the vectors to be displayed. See the example 42 to understand how the taylorplot routine works.
Boundaries Behaviour This flag affects the routine Boundaries, if it is > 0 (default) this routine will write on the plot also the main town of the italian regions/provinces.
Distruggi Fotogrammi This flag affects the subroutine viacolvento. If it set to 0 (default) all the plots used to create the animation will be deleted when the animation has been created.
Openmuseofiles Behaviour This flag affects the routine openmuseofiles and the higher level routines dealing with museo data retrieve; if it is set to zero (default), the routine openmuseofiles stop the execution if an input file cannot be open and a specific message is printed to standard output; if openmuseofiles behaviour is set to 1 the control is returned to the caller the internal integer flag numer 63 is set to 1 (it is usually 0).
Boxplot Style This flag affects the routine Boxplot; if it is set to zero (default), the routine produces 2-dim plots where each pixel is built as a small frame whose color depends on the value of the corresponding array element; if this flag is is set to a value greater then zero the pixel is built like a smalle circle and the radius of the circle will be proportional to the value of Boxplot Style flag; typical value are in the range between 2 and 8; the overall effect is like the painting tecnique usually referred to as "Pointillism". See example 26 to see few plots.
chymdownscaling cycles This flag affects the routine chymdownscaling and allows to establish the number of cycle to be used for Cellular Automata based downsclaing. By default this value is set to zero and the number of CA cycles are calculated as 100xR being R the average ratio between input and output grid resolution.
Random Seed It is the random seed (default=875949887) used to generate a random sequence with a flat (subroutine acaso) or gaussian (subroutine gauss) distribution.
Indice LatLon This flag affects the interpolation routine grinterp; if it is set to zero (default), the arrays manipulated by grinterp have as first index the longitude; otherwise if Indice LatLon is set to other value the first index is the latitude (as for MM5 output arrays).
Plotta color (Colore Plotta) Specify the color of the curves drawn by plotta subpackage. By default the value of this parameter is zero and it means that color index is chosen by plotta, the first curve will with color index 6, the second with color index 7 and so on.
Plotta fill Specify if curves drawn by plotta subpackage must be filled or not, default is 0 (no fill).
Colore freccette This parameter affects the behaviour of subroutines boxarrow and boxzoomarrow allowing to select the color of the arrows. See also the example 30.
Stile freccette This parameter affects the behaviour of subroutines boxarrow and boxzoomarrow allowing to select the style of the arrows. See also the example 30.
Coordinate Grafiche This parameter affects the behaviour of subroutine scrivisulplot, if it is set to 1 (default) the coordinate passed to this routine must be in the range 0-1; if it is set to 2, the coordinate passed to scrivisulplot will be intended as latitude and longitude; if it is set to 3 the coordinate passed to scrivisulplot will be intended as the "current coordinates" and no scaling is carried out by this routine. See also the example 21.
Ogni quanti colori This flag affects the routine plotpalette (and also all the suboutines calling plotpalette) allowing to set the step to be used when producing the label bar, the default is 1 and therefore all the colours are included in the palette. See also the example 1
Java Window Size This flag affects the routine javascript1 that creates a javascript code allowing to spawn an external window with an image. This parameter allows to specify the size (in pixel) of such window. The java script is then used by the routine htmltable.
Html Style This flag allows to select the style of html documents created using the html subpackage.
Html Table Color This flag affects the routine htmltabel allowing to create each element of html table with a different color. The followin table show the different valid value of this option and the corresponding code.
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Flags for 1D plots
Plot 1D Serve nella subroutine meteogrammi a "sapere" se i vettori x e y hanno 1 o 2 dimensioni. In pratica ha lo stesso significato del parametro ROW di authograph. Se = 2 vuol dire che i vettori X e Y sono dimensionati (PUNTI,CURVE) altrimenti X e' dimensionato solo per i punti. Default=1.
Reset Asse X Se > 0 nella sub. meteogrammi resetta l'asse X prima di produrre ogni grafico, utilizzando il minimo e massimo del vettore x che viene passato. E' necessario "alzare" questa flag se si intende produrre grafici con diverse scale sull'asse X.
Size delle Linee Specifica lo spessore delle Curve di livello e dei confini prodotti dalla subroutine nuoviconfini. Default=1.0.
Flags for 2D plots
Colore Isolinee E' il colore con cui vengono tracciate le curve di livello, vedi la documentazione sulle routines contorni ed mm5contorni tra le routine grafiche, oppure l'esempio 9.
Numero Di curve Numero di curve di livello o di Colori nelle mappe a colori. Il Default è 0 e di conseguenza sono routine di grafica a calcolare questo valore.
Colore Confini E' il colore con cui disegna i confini politici Default=0.
Scrivi Max-Min Se questa flag è 0, non viene prodotta la scritta con massimo minimo ed intervallo dalle routines mm5contorni e contorni. Il default è 1 quindi la "information label viene prodotta.
Curva di Livello Chiamando in sequenza 3 volte questo parametro si specifica rispettivamente il minimo, il massimo e l'intervallo con cui vengono prodotte le curve di livello.
Size delle Linee Specifica lo spessore delle Curve di livello e dei confini prodotti dalla subroutine nuoviconfini. Default=1.0.
Flags for MM5 plot
Numero Colori Plot2d
e
Colori Plot2d
Questi due parametri permettono di regolare il numero di colori e gli intervalli con cui vengono prodotti i plot a colori 2D e segnatamente quelli prodotti con le routines mm5colormap ed mm5colorzoom. Il parametro Numero Colori Plot2d indica il metodo con cui si vogliono specificare gli intervalli, mentre le successive chiamate al secondo parametro Colori Plot2d permettono di specificare i vari valori degli intervalli, in pratica chimando questa routine si riempie un vettore che indicheremo qui con x(I). Il primo parametro Numero Colori Plot2d è posto di default a zero e questo fa si che le routines "decidano autonomamamente il numero di colori e l'intervallo da utilizzare. In questo caso il vettore x(I) è ignorato. Invece:
  • se è posto uguale a -1 vuol dire che si intende specificare il minimo il massimo e l'intervallo. Il tal caso x(1), x(2) ed x(3) rappresenteranno rispettivamente l'intervallo, il massimo ed il minimo.
  • se è posto uguale a -2 vuol dire che si intende specificare solo l'intervallo. Il tal caso x(1) rappresenteranno tale intervallo.
  • se è posto uguale a N con N > 0 vuol dire che si vuole un plot con N colori scelti dalla routine.
  • se è posto uguale a -N con il valore assoluto di N > 2 vuol dire che si vogliono abs(N)-2 colori e che i valori vengono esplicitamente specificati con, appunto, abs(N)-2 chiamate al parametro Colori Plot2d.
La chiamata al parametro Colori Plot2d con il valore -9999.0 resetta il contatore e quindi la prossima chiamata specificherà il primo valore. L'esempio 18 illustra il funzionamento di questa coppia di parametri.
Cellular Automata
cellular step Questa flag "dice" al package "cellular" se il singolo automa ha un valore binario (la flag è 0) oppure da un valore discretizzabile con questo particolare valore. E' utilizzata solo nella routine cellularplot.
Cellular weights N
Cellular weights E
Cellular weights S
Cellular weights O
Cellular weights NE
Cellular weights NO
Cellular weights SE
Cellular weights SO
Questo gruppo di 8 flags è usato dalla routine d2cellcycle come i pesi da assegnare alle varie celle dell'intorno. Se si usa l'intorno di Von Neumann, vengono utilizzate solo le prime 4. Per maggiori particolari vedi la descrizione della routine d2cellcycle. Per default il valore e' 1.0, per cambiare questi valori usare, ad esempio, la sintassi:

CALL MVSETFLAGS('Cellular weights NE',1.0/SQRT(2.0))


Il valore 1.0/SQRT(2.0) e' quello piu' ragionevole da usare per una griglia equispaziata per le celle NE, NO, SE e SO.
Miscellanea
qnorm number of bin Da Documentare
numero di curve Da Documentare
video control Da Documentare
som neural init It is udeb by somepoch sunroutine, to initialize the neurons. If it is = 1 (default) all the neurons are initialized close to the center of the range, i.e. in the interval [0.48-0.52]; if it is = 2 all the neurons are initialized in the whole range [0-1]
som neural distance Da Documentare
-

Other routines to manipulate internal MVLib variables.
resetmvlibint This subroutine is usually used by different MVLib routines to reset the internal flags to their default value (-9999).
getmvlibint(i)
igetmvlibint(i)
getmvlibint is a real function and igetmvlibint is an integer function allowing to retrieve the current value of the ith component of MVLib internal flags specified as argument. These flags are usually set by MVLib routines to provide additional information to the user. Each subroutine usually call resetmvlibint and then call setmvlibintr and setmvlibinti to set specific component. The caller may use getmvlibint and igetmvlibint to check the value of the components. Specific meaning for different subroutines are listed below:
  • chymlocateriver
    • Integer 1: number of adjacent cells used to locate the river
    • Real 1: Drained area of located cell
  • chymrecord
    • Integer 1: if different from default value, the input file has been rewound to read the selected field
  • openmuseofiles
    • Integer 1: if = 1 last openmuseofiles fails.
setmvlibintr(i,r)
setmvlibinti(i,j)
These two subroutines allow to set the values of MVLib internal flags, they are usually called by library routines. Each subroutine usually call resetmvlibint and then call setmvlibintr and setmvlibinti to set specific component. The caller may use getmvlibint and igetmvlibint to check the value of the components.
mvsaveflags It allows to save all the internal variables in a temporary vector. It is reccomended to avoid conflicts between different routines.
mvrestflags It allows to restore all the internal variables in a temporary vector, that you previously saved by mvsaveflags routine. It is reccomended to avoid conflicts between different routines.
mvsetiflags(comp,value) It allows to directly set the value of an integer parameter without an explicit call to mvsetflags routine. Both arguments are integer: comp is component to set with the value value.
mvgetiflags(comp,value) It allows to directly get an integer value from internal MVLib variables. It is usually used in the MVLib routines especially during the developping phase, in order to avoid to esplicitely include all MVLib common block. It is also used to work under the "implicit none" statements. comp is the component to be retrieved and value is the integer value provided by the routine.
mvliberror(caller,msg,icode,rcode) This routine displays an error message with a standard format and then exit with the status code=1. caller is a string specifying the routine producing the error code, msg is a string containing the error description, icode and rcode are respectively an integer and a real value to be displayed. These variables are not displayed if the value is -9999 and -9999.0 respectively.
mvlibmagicnum(i) It is an integer function returning important values dealing with the installation of MVLib package and the availability of MuSEO database data. The kind of information is selected by the integer argument, more specifically, depending on the value of the argument, the following information are retrieved:
  1. The number of records of dewetra database
  2. The first year for which observed temperature/precipitation data base are available for Italy. These data are usually retrieved with hourlyrain and hourlytemp subroutines.
  3. The last year for which observed temperature/precipitation data base are available for Italy, this is usually established by the data of installation of MVLib. These data are usually retrieved with hourlyrain and hourlytemp subroutines.
  4. The first year for which observed temperature/precipitation data base are available for the rest of the world. These data are usually retrieved with worldrain and worldtemp subroutines.
  5. The last year for which observed temperature/precipitation data base are available for the rest of the world. These data are usually retrieved with worldrain and worldtemp subroutines.
  6. The year of installation of MVLib.