source: trunk/LMDZ.COMMON/libf/evolution/display.F90 @ 4134

Last change on this file since 4134 was 4117, checked in by jbclement, 8 days ago

PEM:

  • Remove 'd_h2oice' and 'd_co2ice' arguments from adsorption and soil thermal inertia routines (not needed and possible bugs).
  • Move 'read_callphys' call from 'read_start1D' to 'read_rundef' so that 'CO2cond_ps' is initialized no matter what.
  • Explicit initialization of 'delta_h2o_ads'/'delta_co2_ads' before 'read_startpem'.
  • Add time index argument to 'put_var_nc' calls to write "restart.nc".
  • Increase temporary string buffer size for 'real2str_qp'.
  • Fixed some typos.

JBC

File size: 29.6 KB
Line 
1MODULE display
2!-----------------------------------------------------------------------
3! NAME
4!     display
5!
6! DESCRIPTION
7!     Contains wrappers to print information.
8!
9! AUTHORS & DATE
10!     JB Clement, 12/2025
11!
12! NOTES
13!
14!-----------------------------------------------------------------------
15
16! DEPENDENCIES
17! ------------
18use, intrinsic :: iso_fortran_env, only: stdout => output_unit
19use, intrinsic :: iso_fortran_env, only: stderr => error_unit
20use, intrinsic :: iso_fortran_env, only: stdin => input_unit
21use numerics,                      only: dp, di, li, k4, minieps
22
23! DECLARATION
24! -----------
25implicit none
26
27! PARAMETERS
28! ----------
29integer(di),    parameter          :: LVL_ERR = 0_di    ! Only errors
30integer(di),    parameter          :: LVL_WRN = 1_di    ! Warnings
31integer(di),    parameter          :: LVL_NFO = 2_di    ! Information (default)
32integer(di),    parameter          :: LVL_DBG = 3_di    ! Debug
33character(11),  parameter, private :: logfile_name = 'pem_run.log'
34character(128), protected, private :: curr_dir = ' '    ! Current directory
35character(32),  protected, private :: username = ' '    ! User name
36character(32),  protected, private :: hostname = ' '    ! Machine/station name
37integer(di),    protected, private :: verbosity_lvl = LVL_NFO
38logical(k4),    protected, private :: out2term = .true. ! Flag to output to terminal
39logical(k4),    protected, private :: out2log = .false. ! Flag to output to log file
40integer(di),    protected, private :: logunit = -1_di   ! Log file unit
41
42contains
43!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
44
45!=======================================================================
46SUBROUTINE set_display_config(out2term_in,out2log_in,verbosity_lvl_in)
47!-----------------------------------------------------------------------
48! NAME
49!     set_display_config
50!
51! DESCRIPTION
52!     Setter for 'display' configuration parameters.
53!
54! AUTHORS & DATE
55!     JB Clement, 03/2026
56!
57! NOTES
58!
59!-----------------------------------------------------------------------
60
61! DECLARATION
62! -----------
63implicit none
64
65! ARGUMENTS
66! ---------
67logical(k4), intent(in) :: out2term_in, out2log_in
68integer(di), intent(in) :: verbosity_lvl_in
69
70! LOCAL VARIABLES
71! ---------------
72integer(di)    :: ierr
73character(100) :: msg
74
75! CODE
76! ----
77out2term = out2term_in
78out2log = out2log_in
79verbosity_lvl = verbosity_lvl_in
80call print_msg('out2term      = '//merge('true ','false',out2term),LVL_NFO)
81call print_msg('out2log       = '//merge('true ','false',out2log),LVL_NFO)
82write(msg,'(a,i1)') 'verbosity_lvl = ',verbosity_lvl
83call print_msg(msg,LVL_NFO)
84if (verbosity_lvl < 0 .or. verbosity_lvl > 3) then
85    write(stderr,'(a,i5,a)') '[ERROR] Stopping in "'//__FILE__//'" at line ',__LINE__,'.'
86    write(stderr,'(a)') '[ERROR] Reason: ''verbosity_lvl'' outside admissible range [0,3]!'
87    write(stderr,'(a)') '[ERROR] Houston, we have a problem! Error code = 1'
88    error stop 1
89end if
90
91if (out2log) then
92    open(newunit = logunit,file = logfile_name,status = 'replace',form = 'formatted',action = 'write',iostat = ierr)
93    if (ierr /= 0) then
94        write(stderr,'(a,i5,a)') '[ERROR] Stopping in "'//__FILE__//'" at line ',__LINE__,'.'
95        write(stderr,'(a)') '[ERROR] Reason: error opening file "'//logfile_name//'"!'
96        write(stderr,'(a,i3)') '[ERROR] Houston, we have a problem! Error code = ',ierr
97        error stop ierr
98    endif
99endif
100if (.not. out2term .and. .not. out2log) write(stdout,*) 'Warning: no output is set!'
101
102END SUBROUTINE set_display_config
103!=======================================================================
104
105!=======================================================================
106SUBROUTINE print_ini()
107!-----------------------------------------------------------------------
108! NAME
109!     print_ini
110!
111! DESCRIPTION
112!     Print the initial display for the PEM.
113!
114! AUTHORS & DATE
115!     JB Clement, 12/2025
116!
117! NOTES
118!
119!-----------------------------------------------------------------------
120
121! DECLARATION
122! -----------
123implicit none
124
125! LOCAL VARIABLES
126! ---------------
127character(8)              :: date
128character(10)             :: time
129character(5)              :: zone
130character(100)            :: msg
131integer(di), dimension(8) :: values
132
133! CODE
134! ----
135call print_msg('  *    .          .   +     .    *        .  +      .    .       .      ',LVL_NFO)
136call print_msg('           +         _______  ________  ____    ____      *           + ',LVL_NFO)
137call print_msg(' +   .        *     |_   __ \|_   __  ||_   \  /   _|          .       *',LVL_NFO)
138call print_msg('          .     .     | |__) | | |_ \_|  |   \/   |  *        *      .  ',LVL_NFO)
139call print_msg('       .              |  ___/  |  _| _   | |\  /| |      .        .     ',LVL_NFO)
140call print_msg('.  *          *      _| |_    _| |__/ | _| |_\/_| |_                  * ',LVL_NFO)
141call print_msg('            +       |_____|  |________||_____||_____|   +     .         ',LVL_NFO)
142call print_msg('  .      *          .   *       .   +       *          .        +      .',LVL_NFO)
143
144! Some user info
145call date_and_time(date,time,zone,values)
146call getcwd(curr_dir)
147call getlog(username)
148call hostnm(hostname)
149call print_msg('',LVL_NFO)
150call print_msg('********* PEM information *********',LVL_NFO)
151call print_msg('+ User     : '//trim(username),LVL_NFO)
152call print_msg('+ Machine  : '//trim(hostname),LVL_NFO)
153call print_msg('+ Directory: '//trim(curr_dir),LVL_NFO)
154write(msg,'(a,i2,a,i2,a,i4)') '+ Date     : ',values(3),'/',values(2),'/',values(1)
155call print_msg(msg,LVL_NFO)
156write(msg,'(a,i2,a,i2,a,i2,a)') '+ Time     : ',values(5),':',values(6),':',values(7)
157call print_msg(msg,LVL_NFO)
158call print_msg('',LVL_NFO)
159call print_msg('********* Initialization *********',LVL_NFO)
160
161END SUBROUTINE print_ini
162!=======================================================================
163
164!=======================================================================
165SUBROUTINE print_end(i_pem_run,n_yr_run,n_yr_sim,dur_secs,pem_ini_date,r_plnt2earth_yr)
166!-----------------------------------------------------------------------
167! NAME
168!     print_end
169!
170! DESCRIPTION
171!     Print the ending display for the PEM.
172!
173! AUTHORS & DATE
174!     JB Clement, 01/2026
175!
176! NOTES
177!
178!-----------------------------------------------------------------------
179
180! DECLARATION
181! -----------
182implicit none
183
184! ARGUMENTS
185! ---------
186real(dp),    intent(in) :: n_yr_run, n_yr_sim, dur_secs, pem_ini_date, r_plnt2earth_yr
187integer(di), intent(in) :: i_pem_run
188
189! LOCAL VARIABLES
190! ---------------
191character(100) :: msg
192
193! CODE
194! ----
195call print_msg('',LVL_NFO)
196call print_msg('****** PEM final information *******',LVL_NFO)
197write(msg,'(a,i0,a,f16.4,a)') '+ The run PEM #',i_pem_run,' achieved ', n_yr_run, ' Planetary years, completed in '//format_duration(dur_secs)//'.'
198call print_msg(msg,LVL_NFO)
199write(msg,'(a,f16.4,a,f16.4,a)') '+ The workflow has achieved ', n_yr_sim, ' Planetary years =', n_yr_sim*r_plnt2earth_yr, ' Earth years.'
200call print_msg(msg,LVL_NFO)
201write(msg,'(a,f16.4,a)') '+ The reached date is now ', (pem_ini_date + n_yr_sim)*r_plnt2earth_yr, ' Earth years.'
202call print_msg(msg,LVL_NFO)
203call print_msg('+ PEM: so far, so good!',LVL_NFO)
204call print_msg('************************************',LVL_NFO)
205call but_why(n_yr_run)
206
207! Close log file
208if (out2log) close(logunit)
209
210END SUBROUTINE print_end
211!=======================================================================
212
213!=======================================================================
214SUBROUTINE print_msg(message,lvl)
215!-----------------------------------------------------------------------
216! NAME
217!     print_msg
218!
219! DESCRIPTION
220!     Print a message (string) based on verbosity.
221!
222! AUTHORS & DATE
223!     JB Clement, 03/2026
224!
225! NOTES
226!
227!-----------------------------------------------------------------------
228
229! DECLARATION
230! -----------
231implicit none
232
233! ARGUMENTS
234! ---------
235character(*), intent(in) :: message
236integer(di),  intent(in) :: lvl
237
238! LOCAL VARIABLES
239! ---------------
240character(:), allocatable :: prefix
241integer(di)               :: outunit
242
243! CODE
244! ----
245! Filter based on verbosity
246if (lvl > verbosity_lvl) return
247
248! Prefix selection
249select case (lvl)
250    case (LVL_ERR)
251        prefix = '[ERROR] '
252    case (LVL_WRN)
253        prefix = '[WARNING] '
254    case (LVL_NFO)
255        prefix = ''
256    case (LVL_DBG)
257        prefix = '[DEBUGGING] '
258    case default
259        write(stderr,'(a,i5,a)') '[ERROR] Stopping in "'//__FILE__//'" at line ',__LINE__,'.'
260        write(stderr,'(a)') '[ERROR] Reason: unknown verbosity level for the message!'
261        write(stderr,'(a)') '[ERROR] Houston, we have a problem! Error code = 1'
262        error stop 1
263end select
264
265! Terminal output
266if (out2term) then
267    if (lvl == LVL_ERR) then
268        outunit = stderr
269    else
270        outunit = stdout
271    end if
272    write(outunit,'(a)') prefix//message
273end if
274
275! Log file output
276if (out2log) write(logunit,'(a)') prefix//message
277
278END SUBROUTINE print_msg
279!=======================================================================
280
281!=======================================================================
282FUNCTION format_duration(secs) RESULT(str)
283!-----------------------------------------------------------------------
284! NAME
285!     format_duration
286!
287! DESCRIPTION
288!     Converts a duration in seconds into a compact Xd HH:MM:SS format.
289!
290! AUTHORS & DATE
291!     JB Clement, 01/2026
292!
293! NOTES
294!
295!-----------------------------------------------------------------------
296
297! DECLARATION
298! -----------
299implicit none
300
301! ARGUMENTS
302! ---------
303real(dp), intent(in) :: secs
304
305! LOCAL VARIABLES
306! ---------------
307integer(di)               :: days, hours, minutes, seconds
308character(:), allocatable :: str
309character(32)             :: tmp ! Work buffer
310
311! CODE
312! ----
313days = int(secs/86400._dp,di)
314hours = int(mod(secs,86400._dp)/3600._dp,di)
315minutes = int(mod(secs,3600._dp)/60._dp,di)
316seconds = int(mod(secs,60._dp),di)
317
318if (days > 0_li) then
319   write(tmp,'(i0,"d ",i2.2,":",i2.2,":",i2.2)') days, hours, minutes, seconds
320else
321   write(tmp,'(i2.2,":",i2.2,":",i2.2)') hours, minutes, seconds
322end if
323
324str = trim(adjustl(tmp))
325
326END FUNCTION  format_duration
327!=======================================================================
328
329!=======================================================================
330SUBROUTINE but_why(n_yr_run)
331!-----------------------------------------------------------------------
332! NAME
333!     but_why
334!
335! DESCRIPTION
336!     Print a cool surprise.
337!
338! AUTHORS & DATE
339!     JB Clement, 02/2026
340!
341! NOTES
342!     \(^o^)/
343!     A rare egg may be hidden somewhere in this module... True trainers
344!     will know better than to consult an AI to hatch it.
345!-----------------------------------------------------------------------
346
347! DECLARATION
348! -----------
349implicit none
350
351! ARGUMENTS
352! ---------
353real(dp), intent(in) :: n_yr_run
354
355! LOCAL VARIABLES
356! ---------------
357integer(di), dimension(5,50), parameter  :: exeggcute = transpose(reshape([ &
358                                                        87,104,97,116,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
359                                                        68,69,65,68,66,69,65,84,45,80,76,65,78,69,84,32,105,115,32,101,118,111,108,118,105,110,103,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
360                                                        84,97,45,100,97,32,46,46,46,32,84,97,45,100,97,32,46,46,46,32,84,97,45,100,97,32,46,46,46,32,84,97,32,116,97,45,100,97,32,116,97,45,100,97,33,0,0,0,0,0,0, &
361                                                        67,111,110,103,114,97,116,117,108,97,116,105,111,110,115,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
362                                                        89,111,117,114,32,68,69,65,68,66,69,65,84,45,80,76,65,78,69,84,32,101,118,111,108,118,101,100,32,105,110,116,111,32,70,65,66,85,76,79,85,83,45,80,76,65,78,69,84,33 &
363                                                        ],[50,5]))
364integer(di), dimension(20,42), parameter :: exeggutor = transpose(reshape([ &
365                                                        73,32,119,97,110,110,97,32,98,101,32,116,104,101,32,118,101,114,121,32,98,101,115,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
366                                                        76,105,107,101,32,110,111,32,109,111,100,101,108,32,101,118,101,114,32,119,97,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
367                                                        84,111,32,98,117,105,108,100,32,116,104,101,109,32,114,105,103,104,116,44,32,116,104,97,116,226,128,153,115,32,109,121,32,114,101,97,108,32,116,101,115,116,0,0, &
368                                                        84,111,32,115,105,109,117,108,97,116,101,32,116,104,101,109,32,105,115,32,109,121,32,99,97,117,115,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
369                                                        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
370                                                        73,32,119,105,108,108,32,116,114,97,118,101,108,32,103,114,105,100,115,32,97,110,100,32,108,97,110,100,115,0,0,0,0,0,0,0,0,0,0,0,0,0, &
371                                                        70,114,111,109,32,99,111,114,101,32,116,111,32,115,107,121,32,115,111,32,119,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
372                                                        84,101,97,99,104,32,112,108,97,110,101,116,115,32,104,111,119,32,116,111,32,117,110,100,101,114,115,116,97,110,100,0,0,0,0,0,0,0,0,0,0,0, &
373                                                        84,104,101,32,112,104,121,115,105,99,115,32,100,101,101,112,32,105,110,115,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
374                                                        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
375                                                        80,76,65,78,69,84,83,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
376                                                        71,111,116,116,97,32,109,111,100,101,108,32,116,104,101,109,32,97,108,108,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
377                                                        73,116,226,128,153,115,32,115,99,105,101,110,99,101,32,97,110,100,32,99,111,100,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
378                                                        73,32,107,110,111,119,32,105,116,226,128,153,115,32,109,121,32,99,97,108,108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
379                                                        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
380                                                        80,76,65,78,69,84,83,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
381                                                        70,114,111,109,32,100,117,115,116,32,116,111,32,103,108,111,119,105,110,103,32,115,112,104,101,114,101,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
382                                                        87,105,116,104,32,116,105,109,101,32,97,110,100,32,114,101,115,111,108,118,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &
383                                                        73,226,128,153,108,108,32,101,118,111,108,118,101,32,116,104,101,109,32,116,104,114,111,117,103,104,32,121,101,97,114,115,0,0,0,0,0,0,0,0,0,0, &
384                                                        32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,226,128,148,32,74,66,67,0,0,0,0 &
385                                                        ],[42,20]))
386real(dp),                      parameter :: first_gen = 151._dp
387character(256), dimension(59)            :: why_not
388character(256), dimension(11)            :: surprise
389integer(di)                              :: i
390
391! CODE
392! ----
393why_not(37) = '⠀⠀⠀⠀⠈⢧⣭⠡⣤⢿⣿⣟⣷⡀⠀⢧⣻⡇⠘⣿⣟⡇⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⢿⣿⣿⣷⣤⣈⠙⠿⠿⣿⣿⣿⣥⣯⣤⣾⡿⠚⠁⠀⢻⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
394why_not(12) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠹⡀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣻⣽⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
395why_not(55) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠓⠦⣤⣀⠀⠉⠉⠉⠀⠀⠉⠉⠉⠍⠀⠀⣀⣤⠴⠀⠉⠛⠂⢿⣷⣦⣌⣙⠛⠻⠿⠿⠿⠷⠙⠛⢁⣴⣿⣷⡇⠀'
396why_not(4)  = '⠀⠀⠀⠀⢀⡴⠚⡉⠍⢉⣉⣉⡁⠒⢂⠄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
397why_not(29) = '⠀⠀⢀⣠⣶⠶⣶⣶⣶⣶⣤⣄⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
398why_not(46) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⡎⢇⢻⣿⣇⠘⠆⠱⢄⠀⠙⢿⣦⣈⠻⣿⣮⣛⣷⣄⠑⠶⣶⣦⣐⣮⣽⣿⣿⣿⣯⣶⣾⠻⡿⢟⡹⠃⠀⢁⠀⠀⠀⣠⣶⠇⡀⠀⠀⠀⠀⠀⠀⠀⠀'
399why_not(8)  = '⠀⠀⠀⠀⠀⠱⡠⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
400why_not(21) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠉⠛⠋⠛⢟⡚⠍⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠴⡀⠀⠀⠀⠀'
401why_not(3)  = ' '
402why_not(41) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⡄⠻⣿⣄⠙⣿⣷⡹⣦⡈⠻⣿⣷⡌⠙⢿⣷⣦⣀⠂⢄⣀⡀⠀⠀⠀⡉⠲⠶⠶⠟⠻⠿⣷⣾⣿⣿⣱⠟⠉⠉⠐⢀⣴⢯⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀'
403why_not(18) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠺⣑⠮⡝⢷⡞⡘⢎⠼⡙⢬⠓⡬⠣⢄⠩⢐⠡⡘⡰⢭⣞⡿⠋⠀⠀⠀⠀⠀⠀⠀⠢⠀⠀⠀⠀⠀⠀⠀⠀'
404why_not(52) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠂⠀⠀⠀⠀⠀⠀⠛⢿⣿⣷⡽⡢⠙⢿⣿⣿⣿⣶⣤⣀⠀⠬⢄⣀⣀⣠⠔⢁⣾⣿⠇⣰⡄⢿⢀⡏⡇'
405why_not(9)  = '⠀⠀⠀⠀⠀⠀⠳⡡⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
406why_not(33) = '⠀⠸⡏⣾⣿⡄⢻⣿⣿⢱⣿⠁⡔⠋⠉⠉⠐⠀⣩⡴⠋⢹⠁⢸⣿⣜⢿⡌⢻⣦⣿⣷⣄⠙⠦⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢦⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
407why_not(1)  = trim(confusion(exeggcute(1,:)))
408why_not(58) = trim(confusion(exeggcute(4,:)))
409why_not(26) = ' '
410why_not(14) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⢿⣻⣿⡿⣿⣾⢷⣯⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
411why_not(47) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⠈⠢⡙⢿⢷⣤⣄⡀⠑⠠⡀⠛⢿⣷⣌⠛⢿⣷⣝⢿⣦⡈⠙⠛⠛⠛⠒⠒⠂⠀⠀⠈⠛⠛⠉⡠⠒⡉⠉⣦⣴⡴⠋⡾⣀⢿⣄⠀⠀⠀⠀⠀⠀⠀'
412why_not(6)  = '⠀⠀⠀⠀⢹⢸⠘⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠰⠠⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
413why_not(40) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣧⡈⢿⣿⣝⢷⣄⠙⢧⡀⣈⠻⣿⣿⣵⠀⠈⠛⠦⡀⠀⠀⠀⠀⠈⠉⠉⠀⠀⠀⣠⢤⣦⣄⣸⣿⡿⣫⣽⣿⣯⠟⠀⣸⣾⡆⠀⠀⠀⠀⠀⠀⠀⠀'
414why_not(24) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠓⠢⢖⡠⠄⢀⠠⠤⠤⠤⠀⢂⠤⢁⡞⠀⠀⠀⠀'
415why_not(35) = '⠀⠀⠘⣇⢻⣿⣇⠸⣿⣿⣿⡀⠇⠀⠀⡼⣿⣿⡇⠀⠀⠀⡀⠀⠻⣟⢿⣿⣿⣤⡀⠘⢿⣿⣿⣿⣿⣤⣄⣀⠀⠀⠀⠠⠄⠀⣀⣠⣿⣿⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
416why_not(10) = '⠀⠀⠀⠀⠀⠀⠀⠱⡁⡂⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
417why_not(59) = trim(confusion(exeggcute(5,:)))
418why_not(16) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⣟⣾⡁⡧⣧⢵⣮⣵⣥⣼⣧⣥⢯⡾⣥⣤⡟⣯⢤⡛⢤⢎⣙⡽⣯⣿⠇⠀⠐⠠⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
419why_not(44) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣦⡀⠀⠀⠀⠙⢛⣦⡈⠻⣷⣎⡻⣦⡈⠻⣿⣿⣶⣯⣝⣿⣿⣿⣖⣲⣶⣤⣤⣤⣄⣤⣤⣴⣶⣶⣶⠻⣉⣠⡴⠟⠁⡰⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀'
420why_not(2)  = trim(confusion(exeggcute(2,:)))
421why_not(31) = '⠀⣼⣿⣼⣿⠏⢠⣾⣿⣿⣿⣿⣿⣷⣶⣬⣝⡛⢷⣦⣄⠀⠀⠀⠀⣀⣤⢤⣴⣶⡶⠛⣛⢫⣿⣶⣾⣶⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
422why_not(49) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣯⠀⠀⢀⠰⣤⠙⣿⣷⣤⣀⠀⠀⠀⠀⠉⢳⣶⣌⠻⢿⣷⣽⡿⣦⣄⠀⠀⠀⣀⣠⣤⣤⣥⡴⣾⠿⠒⠁⣠⣾⠃⢂⢻⣿⣧⡙⣿⣧⠀⠀⠀⠀'
423why_not(19) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠶⣩⠖⣭⠻⣷⣨⡑⣢⢉⠔⡡⢊⢄⡃⣖⣡⢗⡯⠞⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⡀⠀⠀⠀⠀⠀⠀'
424why_not(27) = trim(confusion(exeggcute(3,:)))
425why_not(53) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠳⣄⡈⠐⠠⣑⠢⢤⣄⣀⠁⠒⠒⠲⠦⠄⠀⠀⠀⠈⠛⢿⣷⣦⣌⠛⢿⣾⣿⣻⣿⣿⣿⣶⣦⡤⠤⠒⣐⣴⣿⡏⣿⡇⢸⣿⡆⠀'
426why_not(7)  = '⠀⠀⠀⠀⠸⡄⡜⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣥⣤⣶⣶⣶⣶⣶⣶⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
427why_not(42) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠱⠀⠈⠻⣷⣌⠻⣿⣮⡻⣦⡈⠻⣿⣦⡈⠻⢿⣿⣿⣶⣍⣙⠷⠾⣿⣿⣷⣶⣶⣾⣿⠿⠿⠋⡩⠽⠛⠒⠁⠀⢀⣨⣴⢏⣻⠀⠀⠀⠀⠀⠀⠀⠀⠀'
428why_not(25) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠓⠒⠳⠬⠭⡥⠴⠞⠋⠀⠀⠀⠀⠀'
429why_not(57) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠙⠛⠛⠛⠉⠉⠁⠀⠀⠀'
430why_not(11) = '⠀⠀⠀⠀⠀⠀⠀⠀⠘⢆⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
431why_not(34) = '⠀⠀⢻⡸⣿⣷⠈⣿⣿⣟⣿⠀⠀⠀⠀⠀⣠⣾⣇⠀⠀⠈⠀⠸⣿⣿⣿⣾⡢⠙⠻⣿⣿⣿⣦⣈⠙⠛⠿⢶⣭⣍⠉⠯⠭⠔⠃⠈⣻⣧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
432why_not(20) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠶⣋⢮⣓⢷⡴⡍⢾⣔⣫⢦⣽⡶⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠒⡀⠀⠀⠀⠀⠀'
433why_not(45) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⢷⠻⣯⢦⠀⠀⠀⠀⠙⢿⣦⡈⠻⣿⣮⡻⣦⣀⠙⠪⠝⠛⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢟⣻⣿⣿⣷⠿⢛⠉⠀⠀⠈⠀⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀'
434why_not(5)  = '⠀⠀⠀⠀⣼⢁⠎⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠈⠒⠠⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
435why_not(50) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢧⠀⠈⠢⣙⢷⡜⢧⡉⠛⠿⣦⡀⠀⢄⠈⠛⢧⡷⢆⡙⠻⣿⣿⣿⣿⣦⣄⡉⠉⠉⠉⠀⠈⠀⣠⠴⠋⡴⠁⠀⠀⡄⣿⣿⣧⠘⣿⡄⠀⠀⠀'
436why_not(28) = ' '
437why_not(17) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢻⡽⣹⣷⢮⡓⠮⣝⢾⣹⠽⣞⢧⡝⢶⣡⠛⡤⢃⠎⡱⢊⢶⣹⣿⠟⠀⠀⠀⠀⠐⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
438why_not(39) = '⠀⠀⠀⠀⠀⠀⠀⠹⣿⡄⣒⠈⣿⣯⡻⣦⡈⢻⣎⠈⠻⣿⣿⣦⣄⠈⠢⣤⡀⠀⠀⠀⠀⠀⢌⡙⠒⠀⠈⠙⠛⠛⠛⠛⠛⠉⣠⣤⣦⣤⣤⣿⠟⠀⢿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀'
439why_not(13) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢆⠄⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣽⣿⡽⣾⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
440why_not(56) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠙⠛⠒⠲⠒⠶⠒⠒⠛⠋⠉⠁⠀⠀⠀⠀⠀⠀⠀⠈⠙⠻⠿⢿⣿⣶⣶⣶⣶⣶⡿⠿⣿⡿⠋⠀⠀'
441why_not(22) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠚⢴⡠⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⢠⢃⠀⠀⠀⠀'
442why_not(32) = '⠀⢹⢻⢻⣿⠀⣿⣿⣿⡿⣭⣶⠾⠟⠺⠿⢿⣿⣷⣦⠝⣫⡴⢺⣿⢿⡇⢻⣿⢿⣧⠀⢿⣮⡿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
443why_not(54) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠦⣄⡀⠉⠓⠢⣭⣿⣷⣶⣾⣿⣟⣛⣓⣀⣀⣀⣠⡌⠙⠻⣿⣦⣤⠙⠛⠿⣶⣭⣿⣛⡿⠿⠿⠿⠟⣫⣾⡿⠁⣼⡿⡇⠀'
444why_not(15) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣷⡟⢿⣏⡟⡿⣻⢿⡫⡟⣿⣯⡟⣿⢭⣯⡏⣦⡛⣽⢝⡻⣝⣿⣷⣿⣿⡧⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
445why_not(36) = '⠀⠀⠀⠘⣇⠻⣿⣄⠻⣿⣿⣷⡈⠀⠞⡁⣿⡜⣿⣶⢦⠀⠐⠀⠀⠙⢮⡛⢿⣿⣿⣷⣦⣌⡙⠻⢿⣿⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⡿⡩⢷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
446why_not(48) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣷⡀⠹⡀⠙⠲⣬⣛⢦⡀⠀⠀⠀⠈⠻⣷⣄⠙⠻⣿⣮⡻⣶⣄⡉⠀⠈⠃⠀⠀⠀⠀⠀⠀⠀⠰⠏⢂⣼⠟⠋⠀⣼⢡⣿⣦⠻⣮⣳⡀⠀⠀⠀⠀'
447why_not(23) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠣⣄⡄⡀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡈⠰⢸⠀⠀⠀⠀'
448why_not(38) = '⠀⠀⠀⠀⠀⠈⢻⣷⡉⣤⠻⣿⣿⣿⣄⠈⣿⡿⡌⢾⣿⣧⡀⠀⠀⡀⠀⠀⠀⠀⠀⠙⠷⣮⣙⠛⠿⣿⣿⣿⣿⣿⣿⣿⠿⠟⣋⡀⠀⠀⠁⣠⣾⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
449why_not(30) = '⠀⢠⣿⢟⣵⣿⡿⠛⠛⠛⠛⠛⠻⠿⣷⣦⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'
450why_not(43) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣄⠁⠀⠀⠉⢿⣧⡈⠻⣿⣮⡻⣦⡈⠻⣿⣦⣕⡿⢿⣶⣭⣉⡛⠒⠦⠄⠉⠉⠑⠛⠻⠗⠒⠀⢀⣤⠶⢀⣴⡾⣿⠟⣡⠏⣸⠀⠀⠀⠀⠀⠀⠀⠀⠀'
451why_not(51) = '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣷⡄⠀⠀⠉⠁⠀⠙⣦⠀⠂⡍⠑⠀⠉⠀⠀⠉⢻⠓⣶⡄⠈⠹⣿⣿⣿⣿⣶⣤⠀⠀⠐⠉⠀⢠⡞⠁⠀⠀⠀⡇⢸⣿⡟⣧⢱⢸⣿⡆⠀'
452
453surprise(10) = '⠀⠀⠀⠘⣿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡆⠀'
454surprise(9)  = '⠀⠀⠀⢿⣶⣿⣿⣿⣿⣿⡻⣿⡿⣿⣿⣿⣿⣶⣶⣾⣿⣿⠀⠀'
455surprise(3)  = '⠀⠘⢿⣿⣿⣿⣿⣦⣀⣀⣀⣄⣀⣀⣠⣀⣤⣶⣿⣿⣿⣿⣿⠇'
456surprise(11) = '⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀'
457surprise(5)  = '⠀⠀⠀⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⠋⠀⠀⠀'
458surprise(8)  = '⠀⠀⠀⡁⠀⠈⣿⣿⣿⣿⢟⣛⡻⣿⣿⣿⣟⠀⠀⠈⣿⡇⠀⠀'
459surprise(6)  = '⠀⠀⠀⢠⣿⣿⡏⠆⢹⣿⣿⣿⣿⣿⣿⠒⠈⣿⣿⣿⣇⠀⠀⠀'
460surprise(4)  = '⠀⠀⠈⠻⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀'
461surprise(7)  = '⠀⠀⠀⣼⣿⣿⣷⣶⣿⣿⣛⣻⣿⣿⣿⣶⣾⣿⣿⣿⣿⡀⠀⠀'
462surprise(2)  = '⠀⣿⣿⣿⣷⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣶⣾⣿'
463surprise(1)  = '⢰⣶⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀'
464
465if (gottacatch_emall_()) then
466    call print_msg('',LVL_NFO)
467    if (abs(n_yr_run - first_gen) < minieps) then
468        do i = 1,size(surprise)
469            call print_msg(trim(surprise(i)),LVL_NFO)
470        end do
471        call print_msg('',LVL_NFO)
472        do i = 1,size(exeggutor,1)
473            call print_msg(trim(confusion(exeggutor(i,:))),LVL_NFO)
474        end do
475    else
476        do i = 1,size(why_not)
477            call print_msg(trim(why_not(i)),LVL_NFO)
478        end do
479    end if
480end if
481
482END SUBROUTINE but_why
483!=======================================================================
484
485!=======================================================================
486FUNCTION gottacatch_emall_() RESULT(flag)
487!-----------------------------------------------------------------------
488! NAME
489!     gottacatch_emall_
490!
491! DESCRIPTION
492!     Find the egg.
493!
494! AUTHORS & DATE
495!     JB Clement, 02/2026
496!
497! NOTES
498!     Oh? An egg is about to hatch!
499!-----------------------------------------------------------------------
500
501! DECLARATION
502! -----------
503implicit none
504
505! LOCAL VARIABLES
506! ---------------
507integer(di), dimension(13), parameter :: egg = [80,82,79,70,69,83,83,79,82,95,79,65,75]
508integer(di), dimension(43), parameter :: who = [79,104,63,32,73,116,32,115,101,101,109,115,32,121,111,117,39,114,101,32,110,111,116,32,116,104,101,32,114,105,103,104,116,32,112,101,114,115,111,110,46,46,46]
509character(20)                         :: why_yes
510integer(di)                           :: ierr
511logical(k4)                           :: flag
512
513! CODE
514! ----
515flag = .false.
516call get_environment_variable(trim(confusion(egg)),why_yes,status = ierr)
517if (ierr == 0) then
518    flag = trim(why_yes) == 'yes'
519    if (.not. flag) then
520        call print_msg('',LVL_NFO)
521        call print_msg(trim(confusion(who)),LVL_NFO)
522    end if
523end if
524
525END FUNCTION gottacatch_emall_
526!=======================================================================
527
528!=======================================================================
529FUNCTION confusion(code) RESULT(msg)
530!-----------------------------------------------------------------------
531! NAME
532!     confusion
533!
534! DESCRIPTION
535!     PEM used confusion!
536!
537! AUTHORS & DATE
538!     JB Clement, 02/2026
539!
540! NOTES
541!     USER is confused! It hurt itself in its confusion!
542!-----------------------------------------------------------------------
543
544! DECLARATION
545! -----------
546implicit none
547
548! ARGUMENTS
549! ---------
550integer(di), dimension(:), intent(in) :: code
551
552! LOCAL VARIABLES
553! ---------------
554integer(di)               :: i
555character(:), allocatable :: msg
556
557! CODE
558! ----
559msg = ''
560do i = 1,size(code)
561    if (code(i) /= 0) msg = msg//achar(code(i))
562end do
563
564END FUNCTION confusion
565!=======================================================================
566
567END MODULE display
Note: See TracBrowser for help on using the repository browser.