Welcome to the TRNSYS Users Forum.

The forum is a place where people can interact and have discussions about different topics involving the use of the TRNSYS software package. Here you can post topics for discussion or questions on using TRNSYS and get advice from other users or TRNSYS experts. This forum is not intended for detailed technical support. Users should contact their distributor’s hotline for such assistance.

Some tips for success on using the forum:

  • Follow the Forum Rules posted in Forum Administration.
  • There are categories for different types of topics and questions. Post your topic or question into the proper category.
  • Before posting a topic or question search the existing topics  (and the TRNSYS Users listserv archive or Post archive) to see if a similar topic or question has already been answered.
  • Use a descriptive topic name. Don’t use attention getting subjects, they don’t get attention and only annoy people.
  • State the version of TRNSYS and which add-ons your are using.
  • Include enough specific details for your topic of question to be answered. Just posting “Why am I getting an error?” without describing the specific error and what you are trying to do when you get the error will not receive a response that fixes your issue.
  • Remember when people help you, they are doing you a favor. Be patient, help people out by posting good descriptions of what you need help with, and be polite even if a response does not solve your issue.
  • Moderators may edit your post for clarity or move your topic to a more appropriate category.

Notifications
Clear all

Fortran - TypeStudio Editing an Obsolete Type - Type 60l ( horizontal tank with internal HEX) - conversion .for to .f90

2 Posts
3 Users
0 Reactions
454 Views
0
Topic starter

Greetings to all.

 

I am a TRNSYS beginner, working on modelling a solar thermal installation for my Master Thesis.

I have a TRNSYS V18 with TESSLib17.

I am using the Type 60l under the library :

Obsolete > Detailed Fluid Storage Tank> Horizontal Cylinder > Uniform losses and Node Heights > 1 Inlet, 1 Outlet 

The simulated model requires 14 tanks. I have unfortunately discovered that I cannot put more than 7 duplicates of Type 60l. This is due to a storage array in the source code limited to (800) entries. 

The following error shows whenever I put more than 7 of Type60 ( even in a new model, where I just put tanks, nothing more and run)

 

forrtl: severe(408): fort: (10): Subscript #1 of the array STORE has value 841 which is greater than the upper bound of 800

 

I have successfully located the error source in the source code ( Type60.for  in attached zip ), specifically in lines 48, 1620, 1772.

While it would have been simple to just change the (800) size under TypeStudio and then build a new dll, the .for ( Fortran 77 fixed format) is not "compilable" by TypeStudio, so I had to convert it to .f90 (Free format). This was not straightforward as I have tried several online tools, with no success.

 

I ended up using Yapakit ( http://yapakit.fortran.pagesperso-orange.fr/) which has f77 to f90 conversion feature.

 

From yapakit, I recovered my .f90 converted file ( Type60.f90 in attached zip). Once into TypeStudio, several errors are pointed by the compiler. I kept fixing them until I got stuck on this type of error : (exact screenshot in attached zip)

 

common/type_60dble/Cp,k,Keff,rho,M,&
                                    1
warning : Named COMMON block 'type_60dble' at (1) shall be of the same size as elsewhere (36128 vs 28528 bytes)
D:/../../ccj423sc.o: In function 'type60_': ......... : undefined reference to 'typeck_'

 

You may find the .tsw workspace and also the Type666.f90 file with my current debugging progress,  in attachment. 

 

I am kindly asking if anyone could help me overcome this error, or  even better, review the whole Sourcecode editing - f90 conversion. I am not 100% sure that the conversion tool did its job correctly.

Virtually all I need is changing the STORE(800) to STORE (2000) for example, in 3 locations, with Typestudio.

 

Kind Regard, 

M.SALAH

 

THE ATTACHED ZIP FILE IS IN THIS GOOGLE DRIVE REPOSITORY : https://drive.google.com/file/d/18zNmKausfHy0oWGdxjEiHrmagPMs9-ay/view?usp=sharing *

 

PS : Please note that I already explored using the Type53 of TessLib17 as an alternative horizontal tank, but it has itself a load of problems with .dat file configuration. Type60 has been convenient so far, minus this array limit 

This topic was modified 1 year ago 2 times by Mehdi_S
DavidBradley 14/06/2023 4:39 pm

@mehdi_s
Mehdi,

  I realize this is not exactly an answer to your question but may I ask why you are working with Type60? There are horizontally cylindrical tanks with internal heat exchangers in the v17 TESSLibs. 

kind regards, 

 David

1 Answer
0

Hi Mehdi,

Yes, I remember replying to you on the forum here about the Type 533 plug-in and .dat file. I take it you're still having problems with Type 533? The plug-in DOES work, but it does require that you pay special attention to each and every associated value when changing quantities like the number of tank nodes, number of heat exchanger nodes, number of heat exchangers, etc. Unlike the proforma windows, which can copy a prior parameter/input value and make it 'sticky' if a value cycles multiple times, unfortunately the wizard doesn't have that ability. The wizard just fills in 0's for each new value it encounters until you specifically change them, which is probably why you were getting illegal parameter value errors. (This is one of the reasons the TESSLibs18 version of the horizontal storage tank, Type 1533, allows both a .dat file version and a full parameter version). 

Usually, if a model was moved to the 'Obsolete' folder, it had serious internal problems and is only distributed for backwards compatibility. You're welcome to pursue editing it, but I worry that you'll find yourself fixing one problem only to run into another one. 

If you can be more specific about exactly what you tried changing in the Type 533 wizard that produced the error (you said the default example runs fine?), I might be able to help further. 

Share: