Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a new variable to constrain #473

Open
mpperezp opened this issue Jul 18, 2022 · 2 comments
Open

Adding a new variable to constrain #473

mpperezp opened this issue Jul 18, 2022 · 2 comments

Comments

@mpperezp
Copy link

Hi !
I've been trying to add a new variable to constrain. I'm looking into adding emissions as a constained file because a single value is not suitable for the tests I'm running as I nead weekly variability. On the one hand I thought about adding a new species (e.g EMICO), provide the constrains and parse the value into the desired species to be emitted like so:

% 1 : EMICO = CO ;

However, I don't think this is the best approach. The other option I could think of was to add the emission as an environmental constrain and use as:

% EMICO : CO = ;

To achieve this, I followed what is done for the BLHEIGHT trying to create a variable called EMICO, but I come across an error I can't debug, the model creates the mechanism.f90 file but fails to continue

model/configuration/mechanism.f90:10.132:

EC, BLHEIGHT, EMICO, DILUTE, JFAC, ROOFOPEN, J, RO2) bind(c,name='update_p'
1
Warning: Line truncated at (1)
model/configuration/mechanism.f90:10.132:

EC, BLHEIGHT, EMICO, DILUTE, JFAC, ROOFOPEN, J, RO2) bind(c,name='update_p'
1
Error: Missing closing paren for binding label at (1)
model/configuration/mechanism.f90:12.72:

    integer, parameter :: DP = selected_real_kind( p = 15, r = 307 )
                                                                    1

Error: Unexpected data declaration statement in CONTAINS section at (1)
model/configuration/mechanism.f90:13.54:

       real(c_double), intent(inout) :: p(:), q(:)
                                                  1

Error: Unexpected data declaration statement in CONTAINS section at (1)
model/configuration/mechanism.f90:14.119:`

Below the files I've modified (attached):

./build/mech_converter.py
./src/solverFunctions.f90
./src/constraintFunctions.f90
./src/inputFunctions.f90

I would appreciate any help you can provide, my knowledge in Fortran is very limited. Or if there is another way to add variable emissions.
4.Mod_code.zip

@rs028
Copy link
Collaborator

rs028 commented Jul 21, 2022

@mpperezp I believe you are using an older version of AtChem2, can you please update to the latest version before doing modifications? Second, have a look at PR #432: in that pull request the code was modified to intriduce a new "constrainable" environment variable. You can use those modifications as a guideline. Hope this helps.

@rs028 rs028 moved this to Model Interface and Output in Roadmap Sep 22, 2022
@rs028 rs028 added this to Roadmap Sep 22, 2022
@rs028
Copy link
Collaborator

rs028 commented Oct 5, 2022

@mpperezp did you manage to resolve this?

@rs028 rs028 added the duplicate label Oct 6, 2022
@rs028 rs028 added this to the version 1.5 milestone Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Model Interface and Output
Development

No branches or pull requests

2 participants