Skip to content

Conversation

@ginRosati
Copy link
Collaborator

Add mercury variables to preproc

@ginRosati
Copy link
Collaborator Author

@gbolzon c'è un problema nella creazione del file GIB.
Potrebbe essere legato all'ultima modifica fatta:
TheMask = Mask.from_file(conf.file_mask)

ERROR @line 170 of bclib/lateral.py:
for jt in range(jpt): tmask4d[jt,:,:,:]=mask.mask
TypeError: array() takes 1 positional argument but 2 were given

P.S. @line 50 ho modificato np.bool con np.bool_ perchè dava un errore:
np.bool was a deprecated alias for the builtin bool. To avoid this error in existing code, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here.

@gbolzon
Copy link
Collaborator

gbolzon commented Jan 23, 2025

@ginRosati, risolto il problema di riga 170, avevi ragione, è legato a uno strano comportamento della classe Mask.

Ora però stai attenta a questo problema:
questa parte di lateral.extract_information()
legge dal NetCDF tutto quello che trova, quindi nel nostro caso ottieni un
self.Hg2 = np.array(125,)

poi a riga 39 lo sovrascrivi con un 4D, e questo ti crea il casino di dopo, l'errore che conosci già di riga 118

Il mio consiglio è: non sovrascrivere quello che hai letto dal NetCDF.

Quel lavoro

vp_alk_in = np.append(self.ALK[1],self.ALK[:].T)
vp_alk_in = [np.append(vp_alk_in,self.ALK[end-1])

di avere un profilo da 0 a 5500 serve solo se devi interpolare.
Tu devi, quando hai già il profilo a 125 livelli?

@ginRosati
Copy link
Collaborator Author

Now the code works and produces the GIB file with four state vars for Hg in seawater.
It is also organized to deal with 8 state vars for Hg in plankton, but these are not written to the final file, as they might not be necessary to properly run the model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants